Trích dẫn




Only a person who risks is truly free.


Ảnh

Ảnh

Thứ Bảy, 13 tháng 6, 2015

Quine

I will show you a script that prints itself. The scripts like this is called "Quine". It is useful for writing a virus or doing something...

#include <stdio.h>
int main()
{
char *c="#include <stdio.h>%cint main(){%c%cchar *c=%c%s%c;%c%cprintf(c,10,34,c,34,10,10,10);%c%creturn 0;%c}";
printf(c,10,10,9,34,c,34,10,9,10,9,10);
return 0;
}

It is not complicated but you may need some trick to write Quine-script. You can write a program that rewrite any script to the Quine-Script.



Không có nhận xét nào:

Đăng nhận xét