




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
TopS8cf40a1d97bdeb8e2951c32b910adf7c.pdf7 / 7声明:本资料由 大家论坛计算机考试专区 /index_49.html 收集整理,转载请注明出自 更多计算机考试信息,考试真题,模拟题:/index_49.html 大家论坛,学习的天堂!2006年春浙江省高等学校计算机等级考试试卷(二级C)说明: 考生应将所有试题的答案填写在答卷上。其中试题1试题6,请在答卷上各小题正确选项的对应位置处填“”; 请将你的准考证号的后五位填写在答卷右下角的指定位置内; 考试时间为90分钟;试题1(每小题3分,共12分)阅读下列程序说明和程序,在每小题提供的若干可选答案中,挑选一个正确答案。【程序说明】求 1 + 2/3 + 3/5 + 4/7 + 5/9 + 的前20项之和。 运行示例:sum = 11.239837【程序】#include void main( )int i, b = 1;double s; (1) ; for(i = 1; i = 20; i+) s = s + (2) ; (3) printf( (4) , s);【供选择的答案】(1)A、s = 0B、s = 1 C、s = -1D、s = 2(2) A、i/bB、double(i)/double(b) C、i/2*i-1D、(double)i/(double)b(3) A、;B、b = 2 * i 1; C、b = 1.0 * b; D、b = b + 2; (4) A、sum = %dn B、s = %cnC、sum = %fn D、s = %sn试题2(每小题3分,共12分)阅读下列程序说明和程序,在每小题提供的若干可选答案中,挑选一个正确答案。【程序说明】输入10个整数,将它们从大到小排序后输出。 运行示例:Enter 10 integers: 1 4 -9 99 100 87 0 6 5 34After sorted: 100 99 87 34 6 5 4 1 0 -9【程序】#include void main( ) int i, j, t, a10; printf(Enter 10 integers: ); for(i = 0; i 10; i+) scanf( (5) ); for(i = 1; i 10; i+) for( (6) ; (7) ; j+) if( (8) ) t = aj; aj = aj+1; aj+1 = t; printf(After sorted: ); for(i = 0; i i B、j 9 - i C、j i - 1(8) A、ai-1 ai B、aj+1 aj+2 C、aj aj+1 D、ai aj试题3(每小题3分,共12分)阅读下列程序说明和程序,在每小题提供的若干可选答案中,挑选一个正确答案。【程序说明】输入一个字符串和一个正整数m,将该字符串中的前m个字符复制到另一个字符串中,再输出后一个字符串。运行示例1:Enter a string: 103+895=?Enter an integer: 6The new string is 103+89运行示例2:Enter a string: 103+895=?Enter an integer: 60The new string is 103+895=?运行示例3:Enter a string: 103+895=?Enter an integer: 0The new string is 【程序】#include #include void main( ) char s80, t80, i, m;printf(Enter a string:); gets(s);printf(Enter an integer:);scanf(%d, &m); for(i = 0; (10) ; i+) (11) ; (12) printf(The new string is );puts(t);【供选择的答案】(9) A、ctype.hB、math.h C、stdio.hD、string.h(10) A、i mB、si!= 0 C、si!= 0 & i mD、si!= 0 | i m(11) A、*s+ = *t+B、ti = si C、*t+ = *s+D、si = ti(12)A、ti = 0;B、; C、*+s = 0;D、*+t = 0;试题4(每小题3分,共12分)阅读下列程序并回答问题,在每小题提供的若干可选答案中,挑选一个正确答案。【程序】#include void main( ) int s, x1, y1, z1, x2, y2, z2; printf(Enter 6 integers:);scanf(%d%d%d%d%d%d, &x1, &y1, &z1, &x2, &y2, &z2);s = f(x2, y2, z2) - f(x1, y1, z1);printf(%dn, s);f(int x, int y, int z) int k, n; int tab213 = 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ;n = (x % 4 = 0 & x % 100 != 0 | x % 400 = 0); for(k = 1; k y; k+) z = z + tabnk; return z;(13) 程序运行时,输入1 0 0 0 0 0,输出 (13) 。 A、29B、28C、0 D、-1(14) 程序运行时,输入0 0 1 0 0 0,输出 (14) 。 A、29B、28C、0 D、-1(15) 程序运行时,输入2000 2 1 2000 3 1,输出 (15) 。 A、29B、28C、0 D、-1(16) 程序运行时,输入1981 2 1 1981 3 1,输出 (16) 。 A、29B、28C、0 D、-1试题5(每小题3分,共12分)阅读下列程序并回答问题,在每小题提供的若干可选答案中,挑选一个正确答案。【程序】# include void main ( ) int a = -1, b = 1; void f1(int x, int y), f2(int *x, int *y); void f3(int *x, int *y), f4(int x, int y); f1(a, b); printf(%d,%d)n, a, b); a = -1, b = 1; f2(&a, &b); printf(%d,%d)n, a, b); a = -1, b = 1; f3(&a, &b); printf(%d,%d)n, a, b); a = -1, b = 1; f4(a, b); printf(%d,%d)n, a, b);void f1(int x, int y) int t; t = x; x = y; y = t;void f2(int *x, int *y) int t; t = *x; *x = *y; *y = t;void f3(int *x, int *y) int *t; t = x; x = y; y = t;void f4(int x, int y) int *t = malloc(sizeof(t); *t = x; x = y; y = *t;(17) 程序运行时,第1行输出 (17) 。 A、(1, -1) B、(-1, 1) C、(-1, -1) D、(1,1)(18) 程序运行时,第2行输出 (18) 。 A、(1, -1) B、(-1, 1) C、(-1, -1) D、(1,1)(19) 程序运行时,第3行输出 (19) 。 A、(1, -1) B、(-1, 1) C、(-1, -1) D、(1,1)(20) 程序运行时,第4行输出 (20) 。 A、(1, -1) B、(-1, 1) C、(-1, -1) D、(1,1)试题6(每小题3分,共12分)#include struct card char *face; char *suit;void filldeck(struct card *wdeck, char *wface,char *wsuit)int i; for (i = 0; i 4; i+) wdecki.face = wfacei%2; wdecki.suit = wsuiti/2; void deal(struct card *wdeck)int i; for (i = 0; i 85:260-84:760 2试题8 (14分)编写程序,输入一个正整数n,求下列算式的值。要求定义和调用函数fact(k)计算k的阶乘,函数返回值的类型是double。运行示例:Enter n: 5sum = 1.716672006年春浙江省高等学校计算机等级考试答案(二级C)试题16试题7试题8合计试题16ABCDABCD(1)(13)(2)(14)(3)(15)(4)(16)(5)(17)(6)(18)(7)(19)(8)(20)(9)(21)(10)(22)(11)(23)(12)(24)试题7#include void main( )int mark, a, p, f;c = p = f = 0; printf(Enter scores:);scanf (%d, &mark); while (mark = 0) if(mark = 85) a+; else if (mark = 60) p+; else f+; scanf (%d, &mark); printf(=85:%dn, a);printf(60-84:%dn, p);printf(60:%dn, a);试题8#include void main( ) int i, n; double x, sum; double fact(int n); scanf(%d, &n); sum = 0; for(i=1; i=n; i+) sum = su
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 工程项目进度延误原因分析
- 高中篮球力量训练与运动损伤预防的关系分析
- 2024年四川南充职业技术学院招聘真题
- 老年人慢性疾病护理
- 连锁超市运营总监岗位职责
- 新能源提质增效产能扩展工作计划
- 喘病的护理诊断和措施
- 文化传媒语言文字规范化执行措施
- 班主任安全与法制教育
- 农村健康教育课件
- 2025至2030风力发电用高强度螺栓行业发展趋势分析与未来投资战略咨询研究报告
- 顺产分娩护理课件
- 校园绿化具体管理办法
- 重庆市主城区七校联考2024-2025学年高一下学期期末考试生物学试题
- 2mm土工膜长丝土工布检测报告合格证
- 小小科学家《物理》模拟试卷A(附答案)
- 中国石油招聘考试最新全真模拟笔试试题(通用能力卷)和答案解析(二)
- 地下室后浇带预制免拆封堵施工工法
- 口腔疾病分子生物学课件
- 工程物料五金商品清单大全及价格
- 国家网络安全检查操作指南
评论
0/150
提交评论