C语言问题,求助高手,希望大家多多帮助,谢谢
原始文件内容:000mA 253mA 253mA 129mA 254mA 254mA 253mA 253mA 129mA 253mA 129mA 129mA
135mA 225mA 225mA 193mA 128mA 135mA 225mA 225mA 193mA 225mA 193mA 193mA
000mA 000mA 000mA 000mA 000mA 000mA 000mA ...
问题:是把上面的mA变成空格,然后存到一个新的文件里面
目前的的进展:
#include "stdio.h"
#include "stdlib.h"
main()
{
FILE *fp1,*fp2;
int b[5];
int a[71];
char i,j;
if((fp1=fopen("d:\\mcutest\\tc\\fu\\file3.txt","r"))==NULL)
{
cputs("can not open the file\n");
fclose(fp1);
}
fp2=fopen("d:\\mcutest\\tc\\fu\\file4.txt","w");
while(fgets(i,71,fp1)!=NULL)
switch(isalpha(i))
{
case '0':printf("%c is not a char\n",i);
break;
default:printf("%c ifs a char\n",j);
break;
}
fclose(fp2);
return;
}
还达不到我要的结果,希望大家帮忙。先谢谢了。一定要用C语言编程哦