欢迎来到天天文库
浏览记录
ID:28160118
大小:305.62 KB
页数:16页
时间:2018-12-08
《C语言考试题库》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1、#include改错#includeintarrmax(intarr[3][3]){inti,j,max;max=arr[0][0];/************found************/for(i=0;i<3;i++)此处将1改为0,并且去掉等号for(j=0;j<3;j++)if(max2、und************/printf("Themaxis:%d",arrmax(a));}将arrmax(a[0][0])改为arrmax(a)2、#defineM10#includevoidmain(){inti,a[100],t;//clrscr();for(i=0;i3、;i编辑#includeintfun(intm){/***********begin***********/inta1,a2,a3,s;a1=m/100;a2=m%100/10;a3=m%10;s=a1+a2+a3;return(s);/************end************/}voidmain(){intm,s;//clrscr();printf("Enterm:");scanf("%4、d",&m);s=fun(m);printf("Resultis:%d",s);4、#include改错#includemain(){inta[10]={10,4,2,7,3,12,5,34,5,9},i,s;clrscr();s=0;/************found************/for(i=0;i<10;i++)去掉等号if(a[i]%2==0)/************found************/s=s+a[i];将i改为a[i]printf("Theresultis:%d5、",s);}5、#include填空#includevoidmain(){intnum,k;//clrscr();/************found************/k=0;给k赋值printf("Pleaseenteranumber:");scanf("%d",&num);do{/************found************/k=k+num%10;num%10可求出num的各位num/=10;}while(num);printf("%d",k);}6、#include6、改错#include#includevoidmain(){inti,j,x,p;//clrscr();x=1;/************found************/j=12;while(j>1)去掉等号{p=(x+1)*2;/************found************/x=p;j--;}printf("totalis%d",p);}7、#include"stdio.h"改错voidmain(){longintf[20]={1,1};inti;//clrscr(7、);/**************found************/f[0]=1;f[1]=1;赋初值for(i=0;i<20;i++){f[i+2]=f[i]+f[i+1];保证前面两个数要输出,所以要这样改/**************found************/if(i%5==0)printf("");i%5==0保证一行5个数输出printf("%8ld",f[i]);}printf("");}8、#include编辑#include#includedouble8、fun(doublex){/***********begin***********/intq;doublen,t,s;n=1;s=0;t=1;q=1;while(fabs(t)>
2、und************/printf("Themaxis:%d",arrmax(a));}将arrmax(a[0][0])改为arrmax(a)2、#defineM10#includevoidmain(){inti,a[100],t;//clrscr();for(i=0;i3、;i编辑#includeintfun(intm){/***********begin***********/inta1,a2,a3,s;a1=m/100;a2=m%100/10;a3=m%10;s=a1+a2+a3;return(s);/************end************/}voidmain(){intm,s;//clrscr();printf("Enterm:");scanf("%4、d",&m);s=fun(m);printf("Resultis:%d",s);4、#include改错#includemain(){inta[10]={10,4,2,7,3,12,5,34,5,9},i,s;clrscr();s=0;/************found************/for(i=0;i<10;i++)去掉等号if(a[i]%2==0)/************found************/s=s+a[i];将i改为a[i]printf("Theresultis:%d5、",s);}5、#include填空#includevoidmain(){intnum,k;//clrscr();/************found************/k=0;给k赋值printf("Pleaseenteranumber:");scanf("%d",&num);do{/************found************/k=k+num%10;num%10可求出num的各位num/=10;}while(num);printf("%d",k);}6、#include6、改错#include#includevoidmain(){inti,j,x,p;//clrscr();x=1;/************found************/j=12;while(j>1)去掉等号{p=(x+1)*2;/************found************/x=p;j--;}printf("totalis%d",p);}7、#include"stdio.h"改错voidmain(){longintf[20]={1,1};inti;//clrscr(7、);/**************found************/f[0]=1;f[1]=1;赋初值for(i=0;i<20;i++){f[i+2]=f[i]+f[i+1];保证前面两个数要输出,所以要这样改/**************found************/if(i%5==0)printf("");i%5==0保证一行5个数输出printf("%8ld",f[i]);}printf("");}8、#include编辑#include#includedouble8、fun(doublex){/***********begin***********/intq;doublen,t,s;n=1;s=0;t=1;q=1;while(fabs(t)>
3、;i编辑#includeintfun(intm){/***********begin***********/inta1,a2,a3,s;a1=m/100;a2=m%100/10;a3=m%10;s=a1+a2+a3;return(s);/************end************/}voidmain(){intm,s;//clrscr();printf("Enterm:");scanf("%
4、d",&m);s=fun(m);printf("Resultis:%d",s);4、#include改错#includemain(){inta[10]={10,4,2,7,3,12,5,34,5,9},i,s;clrscr();s=0;/************found************/for(i=0;i<10;i++)去掉等号if(a[i]%2==0)/************found************/s=s+a[i];将i改为a[i]printf("Theresultis:%d
5、",s);}5、#include填空#includevoidmain(){intnum,k;//clrscr();/************found************/k=0;给k赋值printf("Pleaseenteranumber:");scanf("%d",&num);do{/************found************/k=k+num%10;num%10可求出num的各位num/=10;}while(num);printf("%d",k);}6、#include
6、改错#include#includevoidmain(){inti,j,x,p;//clrscr();x=1;/************found************/j=12;while(j>1)去掉等号{p=(x+1)*2;/************found************/x=p;j--;}printf("totalis%d",p);}7、#include"stdio.h"改错voidmain(){longintf[20]={1,1};inti;//clrscr(
7、);/**************found************/f[0]=1;f[1]=1;赋初值for(i=0;i<20;i++){f[i+2]=f[i]+f[i+1];保证前面两个数要输出,所以要这样改/**************found************/if(i%5==0)printf("");i%5==0保证一行5个数输出printf("%8ld",f[i]);}printf("");}8、#include编辑#include#includedouble
8、fun(doublex){/***********begin***********/intq;doublen,t,s;n=1;s=0;t=1;q=1;while(fabs(t)>
此文档下载收益归作者所有