版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、全国计算机等级二级c语言上机编程题题型(National computer grade two, C language programming questions)First questionsImproving the function of the function of fun is: n personnel examination results of subsection statistics, scores on the a array, the number of the fraction of the deposit to the B array: the results fo
2、r the number of 60 to 69 to b0, 70 to 79 of the number of results for the deposit to the b1, the number of results 80 to 89 of the deposit to the b2, the number of results for the 90 to 99 deposit to the b3, the number of results for the 100 deposit to the b4, the number of scores below 60 points ar
3、e stored in b5.The brand for example, when the data in the array is a:Which was 93, 85, 77, 68, 59, 43, 94, 75, 98.Which was after this call, the data stored in the B array should be:Which was 1, 2, 1, 3, 0, 2.Note: there is a file which was part of the PROG1.C source program.Do not change any conte
4、nt of the brand main function and other function, only fill a number of statements you write the braces in the function fun.Which was Prog1.cWhich was #includeWhich was #includeAPThe brand of void fun (int a, int b, int n)APAPAPAPAP (main)AP int i, a100=93, 85, 77, 68, 59, 43, 94, 75, 98, b6;AP (clr
5、scr);Which was fun (a, B, 9);The brand printf (the result is:);AP for (i=0; i6; i+) printf (%d, bi);The brand printf (n);AP (NONO);APAPAP (NONO)Which was /* the function used to open the file, call the function, input data, output data, close the file. * /The brand FILE *rf, *wf;The brand int a100,
6、b6, I, j;Which was RF = fopen (in1.dat, R);Which was WF = fopen (bc01.dat, W);Which was for (I = 0; I 10; i+) Which was for (J = 0; J 10; j+ fscanf (RF), %d, &aj);Which was fun (a, B, 9);Which was for (J = 0; J 6; j+) fprintf (WF,%d, bj);Which was fprintf (WF, n);APWhich was Fclose (RF);Which was Fc
7、lose (WF);APAPAP program reference answerThe brand of void fun (int a, int b, int n)APThe brand int i;AP (for i=0; i6 i+; bi = 0);AP for (i=0; I AP if (ai 60) b5+;The brand of else b(ai- 60) /10+;APThe second questionImproving the function of the fun function is: the number of statistics of all ages
8、 to coexist in the B array, n personnels age on a array. The age of 1 to 9 of the number of deposited in the b0 age, the number of 10 to 19 of the deposit to the b1, the age of 20 the number to 29 to b2, the age of 30 to 39 of the number of deposit to the b3, the age of 40 to 49 the number of the de
9、posit to the b4, the number of age over the age of 50. To b5.The brand for example, when the a array data:Which was 9, 18, 27, 38, 59, 33, 14, 75, 38.Which was after this call, the data stored in the B array should be:Which was 1, 2, 1, 3, 0, 2.Note: there is a file which was part of the PROG1.C sou
10、rce program.Do not change any content of the brand main function and other function, only fill a number of statements you write the braces in the function fun.Which was #includeWhich was #includeAPThe brand of void fun (int a, int b, int n)APAPAPAPAP (main)AP int i, a100=9, 18, 27, 38, 59, 33, 14, 7
11、5, 38, b6;AP (clrscr);Which was fun (a, B, 9);The brand printf (The result is:);AP for (i=0; i6; i+) printf (%d, bi);The brand printf (n);AP (NONO);APAPAP (NONO)Which was /* the function used to open the file, call the function, input data, output data, close the file. * /The brand FILE *rf, *wf;The
12、 brand int a100, b6, I, j;Which was RF = fopen (in2.dat, R);Which was WF = fopen (bc02.dat, W);Which was for (I = 0; I 10; i+) Which was for (J = 0; J 10; j+ fscanf (RF), %d, &aj);Which was fun (a, B, 9);Which was for (J = 0; J 6; j+) fprintf (WF,%d, bj);Which was fprintf (WF, n);APWhich was Fclose
13、(RF);Which was Fclose (WF);APAP program reference answerThe brand of void fun (int a, int b, int n)APThe brand int i;AP (for i=0; i = 50 b5+);The brand else bai/10+;APThe third questionImproving the function of the fun function is: Statistics in the string a, the number of characters specified below
14、, the coexistence of the B array, including: the number of characters + appears to b0, the number of characters - the deposit to the b1, the number of characters * to the b2 character / the number of deposit to the b3, the number of characters & the deposit to the b4, the number of other characters
15、appear are stored in b5.The brand for example, when the string in the a string: -+*1-a/&b,Which was after this call, the data stored in B should be: 1, 2, 1, 2, 1, 3.Note: there is a file which was part of the PROG1.C source program.Do not change any content of the brand main function and other func
16、tion, only fill a number of statements you write the braces in the function fun.APWhich was #includeWhich was #includeWhich was #includeAPThe brand of void fun (char *a, int b)APAPAPAPAP (main)AP int i, b6; char a100 = -+*1/-a/&b;AP (clrscr);Which was fun (a, B);The brand printf (The result is:);AP
17、for (i=0; i6; i+) printf (%d, bi);The brand printf (n);AP (NONO);APAPAP (NONO)Which was /* the function used to open the file, call the function, input data, output data, close the file. * /The brand FILE *rf, *wf;The brand char a100, *p;The brand int b6, I, j;Which was RF = fopen (in6.dat, R);Which
18、 was WF = fopen (bc06.dat, W);Which was for (I = 0; I 10; i+) Which was fgets (a, 99, RF);Which was p = strchr (a, n);Which was if (P) *p = 0;Which was fun (a, B);Which was for (J = 0; J 6; j+) fprintf (WF,%d, bj);Which was fprintf (WF, n);APWhich was Fclose (RF);Which was Fclose (WF);APAPAP program
19、 reference answerThe brand of void fun (char *a, int b)APThe brand int i;AP (for i=0; i6 i+; bi = 0);AP (for i=0; i strlen; i+ (a)Which was switch (ai)Which was the + case: b0+; break;The brand case -: b1+; break;The brand case *: b2+; break;The brand case: break / b3+;The brand case &: b4+; break;T
20、he brand default: b5+;APAPFourth questionsImproving the function of the function of fun is to reverse n in the a array and B array of n Shuyiyi corresponding results are added in the C array.For example: when the a of the brand value in the array is: 1, 3, 5, 7, 8Improving the b values in the array
21、are: 2, 3, 4, 5, 8Which was after this call, 9, 8, 9, 10, 10 is the data stored in the C arrayNote: there is a file which was part of the PROG1.C source program.Do not change any content of the brand main function and other function, only fill a number of statements you write the braces in the funct
22、ion fun.APWhich was #includeWhich was #includeAPThe brand of void fun (int a, int b, int c, int n)APAPAPAPAP (main)The brand a100=1,3,5,7,8, I int, b100=2,3,4,5,8, c100;AP (clrscr);Which was fun (a, B, C, 5);The brand printf (The result is:);AP for (i=0; i5; i+) printf (%d, ci);The brand printf (n);
23、AP (NONO);APAPAP (NONO)Which was /* the function used to open the file, call the function, input data, output data, close the file. * /The brand FILE *rf, *wf;The brand int a100, b100, c100, I, j;Which was RF = fopen (in.dat, R);Which was WF = fopen (bc01.dat, W);Which was for (I = 0; I 5; i+) 为(J = 0;J5;j+)fscanf(RF,“%d”,和一个 J );为(J = 0;J5;j+)fscanf(RF,“%d”,与B J );(A,B,C的乐趣,5);为(J = 0;J5;j+)fprintf(WF,“%d”,C J );fprintf(WF,“n”);fclose(RF);fclose
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 农村架空配电线路升级改造方案
- 生产车间夏季安全隐患排查作业规范
- 立陶宛食品包装材料行业环保材料研发与应用市场渗透及渗透机制报告
- 2027年湖南潇湘技师学院单招综合素质考试题库附答案详解【B卷】
- 2025年豫西文旅职业学院高职单招职业适应性测试考试题库附参考答案详解(综合卷)
- 2027年武汉城市职业学院高职单招职业适应性测试考试模拟试卷及答案详解【网校专用】
- 2025年延安青年职业学院单招职业技能考试模拟试卷及答案详解一套
- 2027年甘肃省天水市高职单招职业适应性测试考试题库及完整答案详解【夺冠】
- 2026年山东航空产业职业学院单招综合素质考试模拟试卷含完整答案详解(必刷)
- 2025年安阳殷墟文旅职业学院单招职业技能考试模拟试卷(满分必刷)附答案详解
- 执行异议申请书范本
- 2024年兰州市热力总公司招聘笔试冲刺题(带答案解析)
- 第四届西部HR能力大赛考试题库500题(含预测题)
- DLT802.7-2023电力电缆导管技术条件第7部分非开挖用塑料电缆导管
- 危岩稳定性计算表格-滑移式-倾倒式-坠落式-完整版
- 江苏镇江润州区调任公务员(参公管理人员)2人公务员国家公务员考试、考试大纲、历年真题514笔试题库含答案解析
- 大学物理大一教材电子版
- 中国儿童1 型糖尿病标准化诊断与治疗专家共识(2020 版)
- LY/T 2578-2016森林火险预警信号分级及标识
- 马克思主义基本原理概论(笔记整理资料)
- 绝缘电阻测试记录范文
评论
0/150
提交评论