【计算机类职业资格】全国计算机等级考试二级C语言上机题库试卷七2013年3月及答案解析.doc

上传人:eveningprove235 文档编号:1329649 上传时间:2019-10-17 格式:DOC 页数:2 大小:29.50KB
下载 相关 举报
【计算机类职业资格】全国计算机等级考试二级C语言上机题库试卷七2013年3月及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】全国计算机等级考试二级C语言上机题库试卷七2013年3月及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、全国计算机等级考试二级 C语言上机题库试卷七 2013年 3月及答案解析(总分:3.00,做题时间:90 分钟)1.程序通过定义并赋初值的方式,利用结构体变量存储了一名学生的信息。函数 fun的功能是输出这位学生的信息。 请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。 注意:源程序存放在考生文件夹下的 BLANK1.C中。 不得增行或删行,也不得更改程序的结构! 给定源程序: #include typedef struct int num; char name9; char sex; struct int year,month,day ; birthday; float

2、 score3; STU; void show(STU _1_) int i; printf(“/n%d %s %c %d-%d-%d“, tt.num, tt.name, tt.sex, tt.birthday.year, tt.birthday.month, tt.birthday.day); for(i=0; i_2.给定程序 MODI1.C中函数 fun 的功能是:求出数组中最大数和次最大数,并把最大数和 a0中的数对调、次最大数和 a1中的数对调。请改正程序中的错误,使它能得出正确的结果。注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! 给定源程序: #incl

3、ude #define N 20 int fun ( int * a, int n ) int i, m, t, k ; for(i=0;iam) k=m; t=ai;ai=am;am=t; main( ) int x, bN=11,5,12,0,3,6,9,7,10,8, n=10, i; for ( i=0; i_3.请编写一个函数 unsigned fun ( unsigned w ),w 是一个大于 10的无符 号整数,若 w 是 n (n 2)位的整数,函数求出 w的低 n-1 位的数作为函数值返回。 例如:w 值为 5923,则函数返回 923; w 值为 923 则函数返回 23

4、 注意: 部分源程序存在文件 PROG1.C中。 请勿改动主函数 main和其它函数中的任何内容,仅在函数 fun的花括号中填入你编写的若干语句。 给定源程序: #include unsigned fun ( unsigned w ) main( ) unsigned x; printf ( “Enter a unsigned integer number : “ ); scanf ( “%u“, printf ( “The original data is : %u/n“, x ); if ( x am) m=k;。3.请编写一个函数 unsigned fun ( unsigned w )

5、w 是一个大于 10的无符 号整数,若 w 是 n (n 2)位的整数,函数求出 w的低 n-1 位的数作为函数值返回。 例如:w 值为 5923,则函数返回 923; w 值为 923 则函数返回 23。 注意: 部分源程序存在文件 PROG1.C中。 请勿改动主函数 main和其它函数中的任何内容,仅在函数 fun的花括号中填入你编写的若干语句。 给定源程序: #include unsigned fun ( unsigned w ) main( ) unsigned x; printf ( “Enter a unsigned integer number : “ ); scanf ( “%u“, printf ( “The original data is : %u/n“, x ); if ( x 10000) w %= 10000 ; else if(w1000) w %= 1000 ; else if(w100) w %= 100 ; else if(w10) w %=10 ; return w ; )解析:本题是考察考生怎样获取一个符合要求的无符号整数。本题是应用 if条件语句首先判断给出的数是几位数,再模相应的值,最后得出的余数就是结果。

展开阅读全文
相关资源
猜你喜欢
  • EN 61044-1992 en Opportunity-Charging of Lead-Acid Traction Batteries《牵引用铅酸蓄电池组的随机充电(IEC 1044-1990)》.pdf EN 61044-1992 en Opportunity-Charging of Lead-Acid Traction Batteries《牵引用铅酸蓄电池组的随机充电(IEC 1044-1990)》.pdf
  • EN 61047-2004 en DC or AC supplied electronic step-down convertors for filament lamps - Performance requirements《钨丝灯用直流 交流电子降压转换器 性能要求IEC 61047-2004》.pdf EN 61047-2004 en DC or AC supplied electronic step-down convertors for filament lamps - Performance requirements《钨丝灯用直流 交流电子降压转换器 性能要求IEC 61047-2004》.pdf
  • EN 61049-1993 en Capacitors for Use in Tubular Fluorescent and Other Discharge Lamp Circuits Performance Requirements《管形荧光灯和其他放电灯线路用电容器性能要求(IEC 1049-1991和勘误表1992年 修改件)》.pdf EN 61049-1993 en Capacitors for Use in Tubular Fluorescent and Other Discharge Lamp Circuits Performance Requirements《管形荧光灯和其他放电灯线路用电容器性能要求(IEC 1049-1991和勘误表1992年 修改件)》.pdf
  • EN 61050-1992 en Transformers for Tubular Discharge Lamps Having a No-Load Output Voltage Exceeding 1000 V (Generally Called Neon- Transformers) General and Safety Requirements (In.pdf EN 61050-1992 en Transformers for Tubular Discharge Lamps Having a No-Load Output Voltage Exceeding 1000 V (Generally Called Neon- Transformers) General and Safety Requirements (In.pdf
  • EN 61051-1-2008 en Varistors for use in electronic equipement - Part 1 Generic specification《电子设备用压敏电阻器 第1部分 通用规范[替代 CECC CECC 42 000 第1版]》.pdf EN 61051-1-2008 en Varistors for use in electronic equipement - Part 1 Generic specification《电子设备用压敏电阻器 第1部分 通用规范[替代 CECC CECC 42 000 第1版]》.pdf
  • EN 61056-1-2012 en General purpose lead-acid batteries (valve-regulated types) - Part 1 General requirements functional characteristics - Methods of test.pdf EN 61056-1-2012 en General purpose lead-acid batteries (valve-regulated types) - Part 1 General requirements functional characteristics - Methods of test.pdf
  • EN 61056-2-2012 en General purpose lead-acid batteries (valve-regulated types) - Part 2 Dimensions terminals and marking.pdf EN 61056-2-2012 en General purpose lead-acid batteries (valve-regulated types) - Part 2 Dimensions terminals and marking.pdf
  • EN 61057-1993 en Aerial devices with insulating boom used for live working exceeding 1 kV a c (Incorporating Corrigendum October 2005 Remains Current)《超过1kV 交流电带电作业用带绝缘臂的高架装置 包含勘误表.pdf EN 61057-1993 en Aerial devices with insulating boom used for live working exceeding 1 kV a c (Incorporating Corrigendum October 2005 Remains Current)《超过1kV 交流电带电作业用带绝缘臂的高架装置 包含勘误表.pdf
  • EN 61057-2017 en Live working - Insulating aerial devices for mounting on a chassis.pdf EN 61057-2017 en Live working - Insulating aerial devices for mounting on a chassis.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1