版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 落实项目进度及交付成果承诺书8篇
- 数字孪生体系中的人工智能伦理
- 护理职业沟通技巧与团队协作
- 2026年东城语文一模试题及答案
- 2026年小学五年级下册期末查漏补缺卷含答案
- 2026年小学五年级上册素养提升综合卷含答案
- 2026年小学四年级上册数学易错点归因矫正练习卷含答案
- 2026年小学三年级下册语文句子默写专项过关卷含答案
- 2026年小学三年级上册语文期末基础复习卷含答案
- 2026年小学三年级上册数学解决问题练习卷含答案
- 土壤修复行业发展趋势与市场前景分析
- 橱柜合同协议书电子版
- 台安变频器N310使用手册
- 新高考背景下2025年高考物理命题趋势分析与复习备考策略讲座
- CESA-3023-011-《信息技术服务 运行维护服务能力成熟度模型》
- 老旧桥梁翻新整改实施方案
- NB-T20048-2011核电厂建设项目经济评价方法
- DL-T475-2017接地装置特性参数测量导则
- 卵巢恶性肿瘤的保留生育功能治疗
- 2023年新高考II卷数学高考试卷(原卷+答案)
- 中药配方颗粒
评论
0/150
提交评论