C/C++ program that prints its own source code as its output

后端 未结 8 2295
天命终不由人
天命终不由人 2020-11-29 08:25

Wikipedia says it\'s called a quine and someone gave the code below:

char*s=\"char*s=%c%s%c;main(){printf(s,34,s,34);}\";main(){printf(s,34,s,34);}
         


        
8条回答
  •  庸人自扰
    2020-11-29 09:11

    The trick here is that most compilers will compile without requiring you to include stdio.h.

    They will usually just throw a warning.

提交回复
热议问题