全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)

全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)

ID:11912441

大小:42.00 KB

页数:19页

时间:2018-07-14

全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)_第1页
全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)_第2页
全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)_第3页
全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)_第4页
全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)_第5页
资源描述:

《全国计算机等级二级c语言上机编程题题型(national computer grade two, c language programming questions)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、全国计算机等级二级c语言上机编程题题型(Nationalcomputergradetwo,Clanguageprogrammingquestions)FirstquestionsImprovingthefunctionofthefunctionoffunis:npersonnelexaminationresultsofsubsectionstatistics,scoresontheaarray,thenumberofthefractionofthedeposittotheBarray:theresultsf

2、orthenumberof60to69tob[0],70to79ofthenumberofresultsforthedeposittotheb[1],thenumberofresults80to89ofthedeposittotheb[2],thenumberofresultsforthe90to99deposittotheb[3],thenumberofresultsforthe100deposittotheb[4],thenumberofscoresbelow60pointsarestoredinb[5

3、].Thebrandforexample,whenthedatainthearrayisa:Whichwas93,85,77,68,59,43,94,75,98.Whichwasafterthiscall,thedatastoredintheBarrayshouldbe:Whichwas1,2,1,3,0,2.Note:thereisafilewhichwaspartofthePROG1.Csourceprogram.Donotchangeanycontentofthebrandmainfunctionan

4、dotherfunction,onlyfillanumberofstatementsyouwritethebracesinthefunctionfun.WhichwasProg1.cWhichwas#includeWhichwas#includeAPThebrandofvoidfun(inta[],intb[],intn){APAPAP}APAP(main)AP{inti,a[100]={93,85,77,68,59,43,94,75,98},b[6];AP(clrscr);Whichwasfun(a,B,

5、9);Thebrandprintf("theresultis:");APfor(i=0;i<6;i++)printf(%d,b[i]);Thebrandprintf("");AP(NONO);AP}APAP(NONO)Whichwas{/*thefunctionusedtoopenthefile,callthefunction,inputdata,outputdata,closethefile.*/ThebrandFILE*rf,*wf;Thebrandinta[100],b[6],I,j;Whichw

6、asRF=fopen("in1.dat","R");WhichwasWF=fopen("bc01.dat","W");Whichwasfor(I=0;I<10;i++){Whichwasfor(J=0;J<10;j++fscanf(RF),"%d",&a[j]);Whichwasfun(a,B,9);Whichwasfor(J=0;J<6;j++)fprintf(WF,%d,b[j]);Whichwasfprintf(WF,);AP}WhichwasFclose(RF);WhichwasFclose(W

7、F);AP}APAPprogramreferenceanswerThebrandofvoidfun(inta[],intb[],intn){APThebrandinti;AP(fori=0;i<6i++;b[i]=0);APfor(i=0;IAPif(a[i]<60)b[5]++;Thebrandofelseb[(a[i]-60)/10]++;AP}ThesecondquestionImprovingthefunctionofthefunfunctionis:thenumberofstatisticsofa

8、llagestocoexistintheBarray,npersonnel'sageonaarray.Theageof1to9ofthenumberofdepositedintheb[0]age,thenumberof10to19ofthedeposittotheb[1],theageof20thenumberto29tob[2],theageof30to39ofthenumberofdeposittotheb[

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。