打印自己的一段漂亮C程序
#include <stdio.h>
int main()
{
char *p ="#include <stdio.h>%c int main(){char *p=%c%s%c; printf(p, 10, 34, p, 34);}";
printf(p, 10, 34, p, 34);
}
本文介绍了一个巧妙的C程序,该程序能够自我打印源代码。通过使用字符指针和printf函数,实现了程序自身的复制输出。
打印自己的一段漂亮C程序
#include <stdio.h>
int main()
{
char *p ="#include <stdio.h>%c int main(){char *p=%c%s%c; printf(p, 10, 34, p, 34);}";
printf(p, 10, 34, p, 34);
}
1344
654

被折叠的 条评论
为什么被折叠?
