#include <iostream>
using namespace std;
int main() {
string s = " cout << \"#include <iostream>\\nusing namespace std;\\n\\nint main() {\\n string s = \\\"\";\n for (char i : s)\n if (i == '\\n')\n cout << \"\\\\n\";\n else if (i == '\"')\n cout << \"\\\\\\\"\";\n else if (i == '\\\\')\n cout << \"\\\\\\\\\";\n else cout << i;\n cout << \"\\\";\\n\" << s;\n}\n";
cout << "#include <iostream>\nusing namespace std;\n\nint main() {\n string s = \"";
for (char i : s)
if (i == '\n')
cout << "\\n";
else if (i == '"')
cout << "\\\"";
else if (i == '\\')
cout << "\\\\";
else cout << i;
cout << "\";\n" << s;
}
标签:std,prints,string,namespace,itself,program,main,cout
From: https://www.cnblogs.com/recurphy/p/17295794.html