自愉自乐的小程序
来源:互联网 发布:网络攻防学什么 编辑:程序博客网 时间:2024/05/01 10:58
#include <stdio.h>
#include <string.h>
#include <malloc.h>
typedef struct{
char l; //左半字符
char r;//右半字符
}hz;
void main(int argc,char **argv)
{
FILE *p;
FILE *p1;
int i;
hz h[100];
if(argc<3)
{
printf("useage:please enter the file name you want to/n");
printf(" convert and the file name you want to save!/n");
printf("example:convert.exe d://1.txt d://2.txt/n");
return;
}
if((p=fopen(argv[1],"rb"))==NULL)
{
printf("can't open %s!",argv[1]);
return;
}
if((p1=fopen(argv[2],"wb"))==NULL)
{
printf("can't open %s!",argv[2]);
return;
}
while(!feof(p))
{
i=0;
while(1)
{
h[i].l=fgetc(p);
if(h[i].l=='/n'||feof(p))break;
h[i].r=fgetc(p);
if(h[i].r=='/n'||feof(p))break;
i++;
}
while(i--)
{
printf("%c%c",h[i].l,h[i].r);
fputc(h[i].l,p1);
fputc(h[i].r,p1);
}
printf("/n");
fputc('/n',p1);
}
fclose(p);
fclose(p1);
printf("convert success!");
}
#include <string.h>
#include <malloc.h>
typedef struct{
char l; //左半字符
char r;//右半字符
}hz;
void main(int argc,char **argv)
{
FILE *p;
FILE *p1;
int i;
hz h[100];
if(argc<3)
{
printf("useage:please enter the file name you want to/n");
printf(" convert and the file name you want to save!/n");
printf("example:convert.exe d://1.txt d://2.txt/n");
return;
}
if((p=fopen(argv[1],"rb"))==NULL)
{
printf("can't open %s!",argv[1]);
return;
}
if((p1=fopen(argv[2],"wb"))==NULL)
{
printf("can't open %s!",argv[2]);
return;
}
while(!feof(p))
{
i=0;
while(1)
{
h[i].l=fgetc(p);
if(h[i].l=='/n'||feof(p))break;
h[i].r=fgetc(p);
if(h[i].r=='/n'||feof(p))break;
i++;
}
while(i--)
{
printf("%c%c",h[i].l,h[i].r);
fputc(h[i].l,p1);
fputc(h[i].r,p1);
}
printf("/n");
fputc('/n',p1);
}
fclose(p);
fclose(p1);
printf("convert success!");
}
- 自愉自乐的小程序
- 程序的自删除
- 通过批处理实现自删除程序的小改进
- 小程序对接 自写接口
- python之自练习小程序(循环)
- windows自带的程序
- 自删除程序的分析
- Exe程序的自删除
- 程序自启动的方式
- 程序自启动的问题
- Windows的自启动程序
- 程序自启动的方式
- 自写单链表的连接程序
- 关于自加,自减的小总结(初级)
- Windows XP自带的定时关机功能以及我的基于此的小程序
- 用自编的程序实现小波图像分解与重构
- (高手勿进)为pe文件添加CRC32自效验的小程序(vc)
- 自写的一个小程序——小鸟与汽车
- 关于SAP的SD的定价公式的资料(强力推荐,有时间我会进行翻译)
- SQL Server 2000 数据库分离与附加
- Obfuscator v1.0
- 中国男蓝的惊喜-最后六秒三分绝杀
- IT思考——从XML到整个世界
- 自愉自乐的小程序
- 《转贴》- 女孩,当你说没有好男人时请看看
- 没什么进展
- 秋天不回来
- IT思考——客户端技术发展趋势想起的
- 揪出个“伪君子”
- WinXP下网上邻居不能访问的解决方法大全
- 信任,放心
- The Grabber 1.4.4c Beta 3 (The New Version!)