欢迎来到天天文库
浏览记录
ID:58987101
大小:1.46 MB
页数:130页
时间:2020-10-27
《二级C语言机试题目.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、校园网·新视野教育二级C上机考试复习资料V16.0(共50套题目)第1套校园网·新视野教育上机考试复习资料1、程序填空题#include#includedoublefun(doublex){doublef,t;intn;f=1.0+x;/**********found**********/t=___1___;n=1;do{n++;/**********found**********/t*=(-1.0)*x/___2___;f+=t;}/**********found**********/while(___3___>=1e-6);returnf
2、;}main(){doublex,y;x=2.5;y=fun(x);printf("Theresultis:");printf("x=%-12.6fy=%-12.6f",x,y);}2、程序修改题#includelongfun(intx,inty,long*p){inti;longt=1;/**************found**************/for(i=1;i3、ntx,y;printf("Inputxandy:");scanf("%ld%ld",&x,&y);t=fun(x,y,&r);printf("x=%d,y=%d,r=%ld,last=%ld",x,y,r,t);}3、程序设计题校园网·新视野教育上机考试复习资料#include#includedoublefun(doublex){}main(){doublex,s;printf("Inputx:");scanf("%lf",&x);s=fun(x);printf("s=%f",s);}第2套校园网·新视野教育上机考试4、复习资料1、程序填空题#includeintc1,c2,c3;voidfun(longn){c1=c2=c3=0;while(n){/**********found**********/switch(___1___){/**********found**********/case1:c1++;___2___;/**********found**********/case2:c2++;___3___;case3:c3++;}n/=10;}}main(){longn=L;fun(n);printf("Theresult:");printf("n=%ldc5、1=%dc2=%dc3=%d",n,c1,c2,c3);}2、程序修改题校园网·新视野教育上机考试复习资料#includeintfun(unsignedn,int*zero){intcount=0,max=0,t;do{t=n%10;/**************found**************/if(t=0)count++;if(max6、,max;printf("Inputn(unsigned):");scanf("%d",&n);max=fun(n,&zero);printf("Theresult:max=%dzero=%d",max,zero);}3、程序设计题校园网·新视野教育上机考试复习资料#includedoublefun(intn){}main(){intn;doubles;printf("Inputn:");scanf("%d",&n);s=fun(n);printf("s=%f",s);}第3套校园网·新视野教育上机考试复习资料1、程序填空题#7、includeunsignedlongfun(unsignedlongn){unsignedlongx=0;intt;while(n){t=n%10;/**********found**********/if(t%2==__1__)/**********found**********/x=__2__+t;/**********found**********/n=__3__;}returnx;}main(){unsignedlongn=-1;while(n>8、9、n<0){printf("
3、ntx,y;printf("Inputxandy:");scanf("%ld%ld",&x,&y);t=fun(x,y,&r);printf("x=%d,y=%d,r=%ld,last=%ld",x,y,r,t);}3、程序设计题校园网·新视野教育上机考试复习资料#include#includedoublefun(doublex){}main(){doublex,s;printf("Inputx:");scanf("%lf",&x);s=fun(x);printf("s=%f",s);}第2套校园网·新视野教育上机考试
4、复习资料1、程序填空题#includeintc1,c2,c3;voidfun(longn){c1=c2=c3=0;while(n){/**********found**********/switch(___1___){/**********found**********/case1:c1++;___2___;/**********found**********/case2:c2++;___3___;case3:c3++;}n/=10;}}main(){longn=L;fun(n);printf("Theresult:");printf("n=%ldc
5、1=%dc2=%dc3=%d",n,c1,c2,c3);}2、程序修改题校园网·新视野教育上机考试复习资料#includeintfun(unsignedn,int*zero){intcount=0,max=0,t;do{t=n%10;/**************found**************/if(t=0)count++;if(max6、,max;printf("Inputn(unsigned):");scanf("%d",&n);max=fun(n,&zero);printf("Theresult:max=%dzero=%d",max,zero);}3、程序设计题校园网·新视野教育上机考试复习资料#includedoublefun(intn){}main(){intn;doubles;printf("Inputn:");scanf("%d",&n);s=fun(n);printf("s=%f",s);}第3套校园网·新视野教育上机考试复习资料1、程序填空题#7、includeunsignedlongfun(unsignedlongn){unsignedlongx=0;intt;while(n){t=n%10;/**********found**********/if(t%2==__1__)/**********found**********/x=__2__+t;/**********found**********/n=__3__;}returnx;}main(){unsignedlongn=-1;while(n>8、9、n<0){printf("
6、,max;printf("Inputn(unsigned):");scanf("%d",&n);max=fun(n,&zero);printf("Theresult:max=%dzero=%d",max,zero);}3、程序设计题校园网·新视野教育上机考试复习资料#includedoublefun(intn){}main(){intn;doubles;printf("Inputn:");scanf("%d",&n);s=fun(n);printf("s=%f",s);}第3套校园网·新视野教育上机考试复习资料1、程序填空题#
7、includeunsignedlongfun(unsignedlongn){unsignedlongx=0;intt;while(n){t=n%10;/**********found**********/if(t%2==__1__)/**********found**********/x=__2__+t;/**********found**********/n=__3__;}returnx;}main(){unsignedlongn=-1;while(n>
8、
9、n<0){printf("
此文档下载收益归作者所有