Created
October 4, 2022 15:06
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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