程序克隆
打印出自身代码的程序
1、
main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);}
2、
main(){
char b=10,c=34,d=59,*e="char b=10,c=34,d=59,*e=";
char *f,*g,*h,*z="char *f,*g,*h,*z=";
f="printf(";
g="main(){%c%s%c%s%c%c%c%s%c%s%c%c%c%c=%c%s%c%c%c%c=%c%s%c%c%c%c=%c%s%c%c%c%s%c%s";
h=",b,e,c,e,c,d,b,z,c,z,c,d,b,102,c,f,c,d,b,103,c,g,c,d,b,104,c,h,c,d,b,f,103,h);}";
printf(g,b,e,c,e,c,d,b,z,c,z,c,d,b,102,c,f,c,d,b,103,c,g,c,d,b,104,c,h,c,d,b,f,103,h);
}
3、
#include<stdio.h>
main()
{
char *c="#include<stdio.h>%cmain()%c{%cchar *c=%c%s%c;%cprintf(c,10,10,10,34,c,34,10,10);%c}";
printf(c,10,10,10,34,c,34,10,10);
}
4、
#include<stdio.h>
main(_){printf(_,10,34,_="#include<stdio.h>%cmain(_){printf(_,10,34,_=%c%s%c,34);}",34);}
5、
char*s="main(){char*t;t=s;printf(\"char*s=\\\"\");while(*s){if (*s==92||*s==34)printf(\"\\\\\");printf(\"%c\",*s++);}printf(\"\\\";\");while(*t)printf(\"%c\",*t++);}";main({char*t;t=s;printf("char*s=\"");while(*s){if (*s==92||*s==34)printf("\\");printf("%c",*s++);}printf("\";");while(*t)printf("%c",*t++);}
6、
#define q(k)main(){return!puts(#k"\nq("#k")");}
q(#define q(k)main(){return!puts(#k"\nq("#k")");})
7、java
class S{public static void main(String[]a){String s="class S{public static void main(String[]a){String s=;char c=34;System.out.println(s.substring(0,52)+c+s+c+s.substring(52));}}";char c=34;System.out.println(s.substring(0,52)+c+s+c+s.substring(52));}}