免费教程_免费网赚教程_破解版软件-寂涯网络学习基地

当前位置: 主页 > 系统综合 > 各类编程 > 打印出自身的程序

打印出自身的程序

时间:2011-10-21 16:12来源: 整理:寂涯网络 点击:

简短的#include<stdio.h>

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

 

参考http://hi.baidu.com/atyuwen/blog/item/318ceb9b688ea7b2c8eaf412.html#0

 

'\"'使用了斜杠

main(){char* a="main(){char* a=%c%s%c;printf(a,34,a,34);}";printf(a,34,a,34);}中'\"'使用printf("%c",34);输出

'\n'可以使用printf("%c",10);输出

 

 

 

可读性佳的#include<stdio.h>

main(){

    char *s="#include<stdio.h>%cmain(){%c%cchar *s=%c%s%c;%c%cprintf(s,10,10,9,34,s,34,10,9,10);%c}";

    printf(s,10,10,9,34,s,34,10,9,10);

}

//Copyright (c) LeafCore

#include<stdio.h>

void main() {

    char *s="//Copyright (c) LeafCore%c#include<stdio.h>%cvoid main() {%c%cchar *s=%c%s%c;%c%cprintf(s,10,10,10,9,34,s,34,10,9,10);%c}";

    printf(s,10,10,10,9,34,s,34,10,9,10);

}

What a fantasy!

可执行文件生成自身的源文件

//Copyright (c) LeafCore

#include<stdio.h>

main(){

    FILE *fp=fopen("file.c","w");

    char *s="//Copyright (c) LeafCore%c#include<stdio.h>%cmain(){%c%cFILE *fp=fopen(%cfile.c%c,%cw%c);%c%cchar *s=%c%s%c;%c%cfprintf(fp,s,10,10,10,9,34,34,34,34,10,9,34,s,34,10,9,10,9,10,9,10);%c%cfclose(fp);%c%creturn 0;%c}";

    fprintf(fp,s,10,10,10,9,34,34,34,34,10,9,34,s,34,10,9,10,9,10,9,10);

    fclose(fp);

    return 0;

}运行生成的可执行文件,可生成自身的源文件。

本页地址 http://www.jybase.net/biancheng/20111018152.html

百度搜索更多

谷歌搜索更多

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------

评价:
昵称: 验证码:点击我更换图片
推荐内容
赞助商
赞助商


关于本站免责声明视频更新google百度地图视频地图RRS订阅

如有什么问题请在本站留言,或发邮件到 hxt167#foxmail.com