资源描述:
《2010年自考工学类操作系统原理复习资料24471》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、设计1、#includevoidfun(inta,intb,long*c){*c=(a/10)*1000+(b/10)*100+(a%10)*10+(b%10);}main(){inta,b;longc;voidNONO();printf("Inputa,b:");scanf("%d,%d",&a,&b);fun(a,b,&c);printf("Theresultis:%d",c);NONO();}voidNONO(){/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。*/FILE*rf,*wf;inti,a,b;longc;rf=fopen
2、("C:\WEXAM\24990001\in.dat","r");wf=fopen("C:\WEXAM\24990001\out.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);}2、#includevoidfun(inta,intb,long*c){*c=(b/10)*1000+(a%10)*100+(b%10)*10+(a/10);}main(
3、){inta,b;longc;voidNONO();printf("Inputa,b:");scanf("%d,%d",&a,&b);fun(a,b,&c);printf("Theresultis:%ld",c);NONO();}voidNONO(){/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。*/FILE*rf,*wf;inti,a,b;longc;rf=fopen("C:\WEXAM\24990001\in.dat","r");wf=fopen("C:\WEXAM\24990001\out.dat","w");for(i=0;i<10;i
4、++){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);}3、#includevoidfun(inta,intb,long*c){*c=(b%10)*1000+(a%10)*100+(b/10)*10+(a/10);}main(){inta,b;longc;voidNONO();printf("Inputa,b:");scanf("%d,%d",&a,&b);fun(a,b,&c);printf("Theresul
5、tis:%ld",c);NONO();}voidNONO(){/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。*/FILE*rf,*wf;inti,a,b;longc;rf=fopen("C:\WEXAM\24990001\in.dat","r");wf=fopen("C:\WEXAM\24990001\out.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);fclo
6、se(wf);}4、#includevoidfun(inta,intb,long*c){*c=(a%10)*1000+(b/10)*100+(a/10)*10+(b%10);}main(){inta,b;longc;voidNONO();printf("Inputa,b:");scanf("%d,%d",&a,&b);fun(a,b,&c);printf("Theresultis:%ld",c);NONO();}voidNONO(){/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。*/FILE*rf,*wf;inti,a,b;longc;r
7、f=fopen("C:\WEXAM\24990001\in.dat","r");wf=fopen("C:\WEXAM\24990001\out.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);}5、#includefloatfun(float*a,intn){i