NULL) {printf("\n cannot creat!"); exit(0); }int i,fa=1,fb=1; printf(" 请输入第一个数:\n"); scanf ("%s", b1); fputs(b1,fp1); fputs(" ,",fp1); printf(" 请输入第二个数:\n"); /*输入两个超长型数据*/scanf("%s",b2); fputs(b2,fp1); lena =strlen( b1);/*lena 纪录 b1的位数*/lenb =strlen( b2);/*lenb 纪录 b2的位数*/if(b1[0]=='-') {lena--; da=-1;fa=0;} /*判断数组的符号*/ if(b2[0]=='-') {lenb--; db=-1;fb=0;} for (i=0; i<lena; i++,fa++) {a1[i]=b1[lena-fa]-'0'; }/*把字符形数据 b1转为整数形数据,同样用数组纪录*/ for (i=0; i<lenb; i++,fb++) a2[i]=b2[lenb-fb]-'0'; /*同上*/ }void jiafa(int a[],int b[],int f)/*超长型数据加法运算*/ {FILE *fp1; int i,c[MAX+1]={0},s; if((fp1=fopen("xxx.txt","a+"))==NULL) {printf("\n cannot creat!"); exit(0); }if(da*db>0||f) {if(lena>lenb) s=lena; else s=lenb; /*用s 纪录结果的最大位数*/ for(i=0;i<s;i++) {c[i]=a[i]+b[i]+c[i]; c[i+1]=(int)c[i]/10; /*c[i+1] 代表进位*/