打印自身的程序(python和c版)

来源:互联网 发布:数据分析主管 编辑:程序博客网 时间:2024/04/30 00:28

python版

me='me=%r\nprint me %% me'print me % me

网上流传的c版

#include <stdio.h>char* recurse = "#include <stdio.h>%cchar* recurse=%c%s%c;%cvoid main(){printf(recurse,10,34,recurse,34,10,10);}%c";void main(){printf(recurse,10,34,recurse,34,10,10);}


参考文献:

[1] 《Introduction to the Theory of Computation》Michael Sipser  chapter 6

[2] 《哥德尔、艾舍尔、巴赫》侯世达

[3] 《复杂》梅拉妮·米歇尔

[4] 《Theory of Self-Reproducing Automata》 John von Neumann

0 0