文本内容:
习题
55.1单选题CDABA ABDDBDBCB
5.2填空题
205.3改错题(略)
5.4编程题3331•答1i10或i=92j%3!=011for循环,1flag*floatk/k+1或
1.0*flag*k/k+l2flag-flag二其他略1max x2x!=-l3scanfn%dM,x二#include1x=9或xvlO2y=9-xstdio.hn maini{int rs=0;fori=l;i=100;i++s+=i*i;nprintf%d\n s;z}22for循环,其他略n n♦include stdio.h main{int i=l,p=l;double s=l;dos+=l,0/p;p*=++i;}while
1.0/ple-6;printfs;
3.答n#include stdio.h main{int m,n,t,a,b;scanfn%d%dn,m,n;if mnz{t=m;m=n;n=t;}a=m;b=n;t=m%n;whiletn n{m=n;n=t;t=m%n;}printf%d,n;
4.答・#include stdioh”main{int x,y,s=l;乞,scanf d,%d”x,y;for;y0;y——s*=x;printfH%d,%d%d\n s%10s/10%10,s/100%10;z r}
5.答n n♦include stdio.h main{int x,y,z;for x=l;x20;x++for y=l;y33;y++{z=100-x-y;if z%3==05*x+3*y+z/3==100nprintfx=%d,y=%d,z=%d\n,x,y,z;
6.答a・♦include stdiohn main{int j,k;for j=l;j=4;j++{fork=l;k=4-j;k++printfn n;printfn****”•printf\nn;b n#include stdio.h main{int jk;zn nforj=l;j=4;j++{fork=l;k=4-j;k++printf;n nfork=l;k=2*j-1;k++printf*;printf”\n;}
6.答程序分析利用for循环控制在100〜999之间,对每个数分解出个位、十位、百位1♦include stdio.h mainint i,j,k,n;printfwater flowernumbernis:;for n=100;n1000;n++分解出百位*/分解出十位*/i=n/100;/*j=n/10%10;/*k=n%10;/*分解出个位*/ifn==i*i*i+j*j*j+k*k*k nnprintf%-5d,n;printfn\nn;
7.答#include stdio.h mainint x;for x=1000;x=3;x--if x%3==lx%5==2x%7==3”该校的学生人数是:人,printf%d\n”x;break;
8.答#include stdio.h mainx=12,int i=l;while1;{ifx+20+i==2*x+ibreak;i++小明母亲在%年后比小明的年龄大一倍,printf1\n”i;那时小明年龄是岁,小明母亲年龄是%岁\11”,printf%d dx+i,x+20+i;。