Run Code  | Code Wall  | Users  | Misc  | Feedback  | About  | Login  | Theme  | Privacy 

C++ quine

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.74 sec, absolute running time: 0.12 sec, absolute service time: 0.86 sec 
fork mode |  history  | discussion
#include <iostream>
#include <string>
using namespace std;

int main(int argc, char* argv[])
{
    char q = 34;
    string l[] = {
    "    ",
    "#include <iostream>",
    "#include <string>",
    "using namespace std;",
    "",
    "int main(int argc, char* argv[])",
    "{",
    "    char q = 34;",
    "    string l[] = {",
    "    };",
    "    for(int i = 1; i <= 8; i++)",
    "        cout << l[i] << endl;",
    "    for(int i = 0; i <= 17; i++)",
    "        cout << l[0] + q + l[i] + q + ',' << endl;",
    "    for(int i = 9; i <= 17; i++)",
    "        cout << l[i] << endl;",
    "    return 0;",
    "}",
    };
    for(int i = 1; i <= 8; i++)
        cout << l[i] << endl;
    for(int i = 0; i <= 17; i++)
        cout << l[0] + q + l[i] + q + ',' << endl;
    for(int i = 9; i <= 17; i++)
        cout << l[i] << endl;
    return 0;
}