-
-
Save xakepp35/c79649551f78c082e1ef68c61481f1bc to your computer and use it in GitHub Desktop.
C++ Quine
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> | |
int main() { | |
std::string code1 = R"( | |
#include <iostream> | |
int main() { | |
)"; | |
std::string code2 = R"( | |
std::cout << code1 | |
<< " std::string code1 = R\"(" << code1 << ")\";\n" | |
<< " std::string code2 = R\"(" << code2 << ")\";\n" | |
<< code2; | |
} | |
)"; | |
std::cout << code1 | |
<< " std::string code1 = R\"(" << code1 << ")\";\n" | |
<< " std::string code2 = R\"(" << code2 << ")\";\n" | |
<< code2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment