2、++){fscanf(fp,"%d",&n);s=fun(n);fprintf(wf,"%f",s);}fclose(fp);fclose(wf);}#includevoidfun(char*a){inti,j=0;for(i=0;a[i]!=0;i++){if(a[i]!='*')a[j++]=a[i];}a[j]=0;}main(){chars[81];voidNONO();printf("Enterastring:");gets(s);fun(s);printf("Thestringafterdele
3、ted:");puts(s);NONO();}voidNONO(){/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。*/FILE*in,*out;inti;chars[81];in=fopen("in6.dat","r");out=fopen("out6.dat","w");for(i=0;i<10;i++){fscanf(in,"%s",s);fun(s);fprintf(out,"%s",s);}fclose(in);fclose(out);}#includevoidfun(inta,i
4、ntb,long*c){*c=a%10*1000+(a-a%10)+b%10+(b-b%10)*10;}main(){inta,b;longc;voidNONO();printf("Inputab:");scanf("%d%d",&a,&b);fun(a,b,&c);printf("Theresultis:%ld",c);NONO();}voidNONO(){/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。*/FILE*rf,*wf;inti,a,b;longc;rf=fopen("in3.dat","r");w
5、f=fopen("out3.dat","w");for(i=0;i<10;i++){fscanf(rf,"%d,%d",&a,&b);fun(a,b,&c);fprintf(wf,"a=%d,b=%d,c=%ld",a,b,c);}fclose(rf);fclose(wf);}#include#definen10floatfun(floata[n]){inti;floatsum=0.0;for(i=0;i6、调用函数,输出数据,关闭文件。*/FILE*fp,*wf;inti,j;floataver,score[5];fp=fopen("in2.dat","r");wf=fopen("out2.dat","w");for(i=0;i<5;i++){for(j=0;j<10;j++)fscanf(fp,"%f,",&score[j]);aver=fun(score);fprintf(wf,"%5.2f",aver);}fclose(fp);fclose(wf);}main(){inti,k=0;floatave,a[n];for(i=0
7、;iave)k++;printf("ave=%3.1f,k=%d",ave,k);NONO();}#include#defineM100voidfun(intm,int*a,int*n){inti;*n=0;for(i=7;i<=m;i++)if((i%7==0)
8、
9、(i%11==0))a[(*n)++]=i;}main(){intaa[M],n,k;voidNONO();fun(50,a
10、a,&n);for(k=0;k