wb6.c

来自「该套软件用于提取王码98(或者其他版本)的五笔数据」· C语言 代码 · 共 67 行

C
67
字号
#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 + =
减小字号Ctrl + -
显示快捷键?