?? wb6.c
字號:
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <graphics.h>
#include <math.h>
#include <conio.h>
#include <string.h>
#define NG 1
#define OK 0
#define BCD unsigned char
#define CHR unsigned char
#define INT unsigned int
#define PTR long
FILE *stream_father;
FILE *stream_son;
FILE *stream_sonx;
void make_wb2(void);
void main(void)
{
make_wb2();
}
/*相同的漢字有不同的編碼,我們進保留該漢字的最簡單形式的編碼,也就是最少筆畫*/
/****************************************
YYY.TXT==>ZZZ.TXT
****************************************/
void make_wb2(void)
{
CHR buf[256];
CHR buf1[256];
CHR i;
CHR hz1[3];
CHR hz2[3];
hz1[2]='\0';
hz2[2]='\0';
stream_father = fopen("YYY.txt","rt"); /*text*/
stream_sonx= fopen("zzz.txt","wt");
while (!feof(stream_father))
{
fgets(buf,200,stream_father);
hz1[0]=buf[0];
hz1[1]=buf[1];
if(hz1[0]!=hz2[0] ||hz1[1]!=hz2[1])
{
hz2[0]=hz1[0];
hz2[1]=hz1[1];
fprintf(stream_sonx,"%s",buf);
}
}
fclose(stream_son);
fclose(stream_sonx);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -