Skip to content

Instantly share code, notes, and snippets.

@mfukar
Created October 4, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfukar/19116fa92a3b0b78e3fa815e13728861 to your computer and use it in GitHub Desktop.
Save mfukar/19116fa92a3b0b78e3fa815e13728861 to your computer and use it in GitHub Desktop.
fuck this interview question and fuck the people that ask stupid questions that require this answer
#include <iostream>
template<int N>
struct stupid {
static void out(std::ostream& os) {
stupid<N-1>::out(os);
os << N << std::endl;
}
};
template<>
struct stupid<1>{
static void out(std::ostream& os) {
os << 1 << std::endl;
}
};
int main() {
stupid<1000>::out(std::cout);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment