Skip to content

Instantly share code, notes, and snippets.

@ntnn
Created June 2, 2015 18:35
Show Gist options
  • Save ntnn/8112b119c77d7a791a18 to your computer and use it in GitHub Desktop.
Save ntnn/8112b119c77d7a791a18 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
char quote = (char) 34;
char comma = (char) 44;
string code[] = {
"#include <iostream>",
"using namespace std;",
"int main() {",
" char quote = (char) 34;",
" char comma = (char) 44;",
" string code[] = {",
" };",
" for (int i = 0; i < 6; ++i) {",
" cout << code[i] << endl;",
" }",
" for (int i = 0; i < 18; ++i) {",
" cout << quote << code[i] << quote << comma << endl;",
" }",
" for (int i = 6; i < 18; ++i) {",
" cout << code[i] << endl;",
" }",
" return 0;",
"}"
};
for (int i = 0; i < 6; ++i) {
cout << code[i] << endl;
}
for (int i = 0; i < 18; ++i) {
cout << quote << code[i] << quote << comma << endl;
}
for (int i = 6; i < 18; ++i) {
cout << code[i] << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment