c语言_期末复习题答案

申明敬告: 本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。

文档介绍

c语言_期末复习题答案

一、选择题:1.A2.CD3.D4.B5.B6.B7.A8.C9.D10.A11.A12.B13.D14.C15.C16.D17.B18.D19.C20.B21.A22.D23.A24.C25.A26.C27.C28.B29.A30.A31.D32.C33.A34.D35.C36.A37.C38.A39.C40.A41.D42.B43.B44.C45.D46.A47.B48.A49.C50.C51.D52.A53.D54.B55.D56.C57.C58.D59.D60.C61.C62.D63.B64.D65.C二、填空题:1.scanf(“%f”,&x);x>=0scanf(“%f”,&x);2.i<=3或i<4i==0||i==3||j==0||j==5_printf(“n”)3.b=i==0?0:i-1或者i==0?b=0:b=i-14.315.max=q6.i%4==07.88.y*y+x*x9.110.c>=‘a’&&c<=‘z’11.67,D12.713.014.7415.22,1316.717.1818.5,419.3,620.521.1122.723.1024.78625.3226.1027.2,028.i<=10029.a>b30.a[i][j],j==331.“%d*%d=%d”,j,k,j*k32.71n1.2143344535.1536.2237.‘a’==m‘c’==m‘d’==m38.ch>=‘A’&&ch<=‘Z’ch=ch-32;39.b=i==0?0:i-140.3141.c!=‘n’c>=‘0&&c<=‘9’42.i==ja[i][i]或a[j][j]或a[i][j]或a[j][i]43.x*x*x+y*y+z_5判断题:1~10√××√√××√××11~25√×√×××√×××√×√×√26~35√√×××××√√×36~45√××√√×√√××6编程题1.2.3.4.#includevoidmain(){inta,b,c,max;scanf("%d,%d,%d",&a,&b,&c);max=a;if(maxvoidmain(){inta[10],max,i,j;for(i=0;i<10;i++)scanf("%d",&a[i]);max=a[0];j=0;for(i=0;i<10;i++)if(a[i]>max){max=a[i];j=i;}nprintf("Themaximum%disat%d.",max,j);}6.#includevoidmain(){intyueshu(intm,intn);intbeishu(intk,inth,intl);intx,y,c,d;scanf("%d,%d",&x,&y);c=yueshu(x,y);d=beishu(x,y,c);printf("最大公约数是%dn",c);printf("最小公倍数是%dn",d);}intyueshu(intm,intn){inta;a=m%n;while(a!=0){m=n;n=a;a=m%n;}return(n);}intbeishu(intk,inth,intl){return(k*h/l);}7.#includevoidmain(){inta[10],max,i;for(i=0;i<10;i++)scanf(“%d”,&a[i]);max=a[0];for(i=0;i<10;i++)if(maxmain(){charsex;floatscore;scanf("%c,%f",&sex,&score);if(sex=='M')if(score<=15.6)printf("合格");elseprintf("不合格");elseif(sex=='F')if(score<=18.2)printf("合格");elseprintf("不合格");}12.#includemain(){intsum=0,t=-1,i=0,n;scanf(“%d”,&n);while(i
查看更多

相关文章