📄 wb7.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_wbzx_bin(void);
void main(void)
{
make_wbzx_bin();
}
/****************************************
zzz.txt==>zzz.bin
skip combination codes
****************************************/
void make_wbzx_bin(void)
{
CHR buf[256];
CHR code1[5];
CHR hz1[3];
CHR a,i;
CHR *ptr;
CHR *p;
long r;
CHR tmp[20];
hz1[2]='\0';
code1[4]='\0';
stream_father = fopen("zzz.ttx","rt"); /*text*/
stream_son = fopen("zzz.bin","wb");
while (!feof(stream_father))
{
fgets(buf,200,stream_father);
hz1[0]=buf[0];
hz1[1]=buf[1];
if(buf[2]>0xa1) /*if combination sentence,skip*/
{
continue;
}
strcpy(tmp,&buf[2]); /*code field*/
p=tmp;
for(i=0;i<4;i++)
{
a=*p++;
if(a=='\n') break;
code1[i]=a;
}
for(;i<4;i++) code1[i]=' ';
fputc(code1[3],stream_son);
fputc(code1[2],stream_son);
fputc(code1[1],stream_son);
fputc(code1[0],stream_son);
fputc(hz1[0],stream_son);
fputc(hz1[1],stream_son);
}
fclose(stream_son);
fclose(stream_father);
printf("OK\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -