C语言程序设计的试题及答案.docx
《C语言程序设计的试题及答案.docx》由会员分享,可在线阅读,更多相关《C语言程序设计的试题及答案.docx(8页珍藏版)》请在优知文库上搜索。
1、charnum111;charname11;f1.oatscore(3;f1.oataverage;);intmain()structudjypesiu=“200601JWang二80.0,85.0.70叫:stu.avc11ge=rti=0jarca=PPp-rp-11p11ntf(,arca=%.3n.p-arva);return0;5.#inc1.udcstructint_char(inti;charch;);intmain()structint_charx=9,N;printf(*t%5cn,x.i+20,x.ch-2);return0;6.#inc1.udcintInain0stru
2、ctdataintm;intn;union(inty;imz;da;structdataintdata;intdata.m=3;intdata.n=6;in(da(a.da.y=intda(a.n+inidata.n;i11da(a.da.z=intda(a.m-intdata.n;pri11tf(*%5d%5dn,intdata.da.yjntda1.a.da.z):return0:7.Winu1.udeintnain()(inti:oatsun-average=0;(intnum:charnanc(10;intscorc(2:f1.oataverage;:structstudentstru
3、ctstudentda(a2)=1.Mzhangsan60.70h(2.M1.isi89.90|);fdrti=0;i2:i+)datai.average=(data(i.score(0datai.score1.JV2.0;sun-average=sun-average+data(i.average:juim_average=sum_averageZ2:fbr(i=0;idatai).ave11gc)prin!f(*%5d%10s%5.2.datai.nun.da1.a(i.namc,da1.a(i.average);rc1.urn0:8.Minc1.udestructint_dataintd
4、1.,d2;);intmain()structint.datadata2=(2,3,5,6);inti;intsm=10;for(i=0i2i+)scanf(%d.datai.dI.dataiJ.d2);sum=datai.dIdatai.d2sum;printf(sum=%d)w3um);return0;输入:203040509.#iw1.udein(main()unionexastruct(inta;intb;out;intc;intd;e;c.out.a=10;c.out.b);return0;e.out,b=20;e.c=2:c.d=5;Primfr%d,%d11,c.out.a,10
5、. #inc1.udcstructstinta;intb;unionintc;intf;)c;intmain()(structsty;y.a=10;y,c,e=20;y.c.f=y.a;y,b=y.c.e;printf(M%d,%dn*y.c.ey,c.f);return0;)11.#inc1.udestructsia(inta:charb;):structstb(inta:charb:structMac:;i11(nain()strc(stby;y.a=i:y.b=X:y.c.a=y.a5*2:y.c.b=y.b-:Prin1.fr%d.%cW.y.CayCb):return0;)12. W
6、inc1.udeunionst(inta2:intb(2:intc;):intmain()unionsiy;y.a(0=10:y.c=30;return0:y.b1.1=20;printf(w%d,%dnwy.a(O,y.a(1);13. ffinc1.udestruct1.wo(intn;charch;:voidmain()struct(woexI三(5,V);rintR%d,%cn*exI.n+I0.ex1.ch-1):J14. Winc1.udestructIwo(intn;charch:;voidfunc(s1.ructIWoeX2);voidmain()structtwoex1.=u
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言程序设计 试题 答案