Brief # include <stdio. h>
Main () {char * s = "# include <stdio. h> % cmain () {char * s = % c % s % c; printf (s, 10, 34, s, 34) ;}"; printf (s, 10, 34, s, 34 );}
Reference http://hi.baidu.com/atyuwen/blog/item/318ceb9b688ea7b2c8eaf412.html#0
'\ "' Uses a slash
Main () {char * a = "main () {char * a = % c % s % c; printf (a, 34, a, 34 );}"; printf (a, 34, a, 34);} '\ "' uses printf (" % c ", 34); Output
'\ N' can use printf ("% c", 10); Output
Easy to read # include <stdio. h>
Main (){
Char * s = "# include <stdio. h> % cmain () {% c % cchar * s = % c % s % c; % c % cprintf (s, 10, 10, 9, 34, s, 34, 10, 9, 10 ); % c }";
Printf (s, 10, 10, 9, 34, s, 34, 10, 9, 10 );
}
// Copyright (c) LeafCore
# Include <stdio. h>
Void main (){
Char * s = "// Copyright (c) LeafCore % c # include <stdio. h> % cvoid main () {% c % cchar * s = % c % s % c; % c % cprintf (s, 10, 10, 9, 34, s, 34,10, 9, 10); % c }";
Printf (s, 10, 10, 10, 9, 34, s, 34, 10, 9, 10 );
}
What a fantasy!
Executable files generate their own source files
// Copyright (c) LeafCore
# Include <stdio. h>
Main (){
FILE * fp = fopen ("file. c", "w ");
Char * s = "// Copyright (c) LeafCore % c # include <stdio. h> % cmain () {% c % cFILE * fp = fopen (% cfile. c % c, % cw % c); % c % cchar * s = % c % s % c; % c % cfprintf (fp, s, 10, 10, 9, 34,34, 34,34, 34, s, 34,10, 9,10, 9,10, 9,10); % c % cfclose (fp); % c % creturn 0; % c }";
Fprintf (fp, s, 10, 10, 9, 34, 34, 34, 34, 10, 9, 34, s, 34, 10, 9, 10, 9, 10 );
Fclose (fp );
Return 0;
} Run the generated executable file to generate its own source file.