[自考类试卷]2007年下半年全国自考(高级语言程序设计)真题试卷及答案与解析.doc

上传人:roleaisle130 文档编号:911401 上传时间:2019-02-28 格式:DOC 页数:11 大小:50KB
下载 相关 举报
[自考类试卷]2007年下半年全国自考(高级语言程序设计)真题试卷及答案与解析.doc_第1页
第1页 / 共11页
[自考类试卷]2007年下半年全国自考(高级语言程序设计)真题试卷及答案与解析.doc_第2页
第2页 / 共11页
[自考类试卷]2007年下半年全国自考(高级语言程序设计)真题试卷及答案与解析.doc_第3页
第3页 / 共11页
[自考类试卷]2007年下半年全国自考(高级语言程序设计)真题试卷及答案与解析.doc_第4页
第4页 / 共11页
[自考类试卷]2007年下半年全国自考(高级语言程序设计)真题试卷及答案与解析.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

1、2007 年下半年全国自考(高级语言程序设计)真题试卷及答案与解析一、单项选择题1 可以作为自定义标识符的是( )(A)2x(B) break(C) m-n(D)m-n2 正确的变量定义是( )(A)unsigned long d=1000;(B) float m1=m2=10.0;(C) char c1=A,c2=A;(D)double x=0.618,x=3.14;3 表达式的值为 0 的足( )(A)5/5%5(B) 52(C)! 4(D)0x7,则能正确执行的语句是( )(A)scanf(“%d,%d“,x-y,x+y) ;(B) printf(“%dn“,a%b) ;(C) prin

2、tf(“%fn“,a+b);(D)scanf(“%d,%d“,x,y) ;7 设 chars10=“abcde“,t=“12345“;则 s 和 t 在内存中分配的字节数分别是( )(A)6 和 5(B) 6 和 6(C) 10 和 5(D)10 和 68 设 inta=10,*p=3;i+)printf(“%5d“,f(i); printf(“n“); 28 #define SIZE 4 main() int nSIZE=8,3,4,1; int i,j; for(i=0;i SIZE;i+) printf(“%d“,ni); for(j=1;j =ni;j+)printf(“*“): pr

3、intf(“n“); 29 int fm(int a,int b) if(b=1)return a; else return a+fm(a,b-1); main() printf(“%dn“,fm(4 ,3); 四、程序填充题30 函数 fun 用于计算数组各元素值的平方,主函数调用 fun 并输出各元素的值。 void fun(int num,int a) int i; for(i=0;i _;i+)ai=ai*ai; /*第一空 */ main() int i,b5=1,2,3,4,5); fun(5,_); /*第二空 */for(i=0;i5;i+)printf(“%5d“ ,_);

4、/*第三空*/printf(“n“);31 从键盘输入一串字符(“#“作为结束标志),将其写入文本文件 file.dat 中保存。#includestdio.h #includestdlih.h main()char ch; FILE*fp:if(fp=fopen(“file.det“,“_“)=NULL)/*第一空*/printf(“Can not open filen“);exit(0) ;ch=getchar(); whil(ch!#) fputc(_,fp);/*第二空 */ ch=getchar();fclose(_); /*第三空*/32 从键盘输入 x 的值,根据以下公式计算并输

5、出 x 和 y 的值。 #include%math.h #includestdio.h main() float x,y; scanf(“%f“._);/*第一空*/ if(x 0)printf(“input error!n“); else switch(int)(x/2) case 0:yx;_;/*第二空*/ case 1: case 2:y=x*x+1;break ; case 3: case 4:y=_;break;/*第三空*/ default:y=1/(x*x+1); printf(“x=%7.2f,y=%10.6fn“,x,y); 五、程序设计题33 从键盘输入 100 个整数,

6、计算并输出大于等于零的数的平均值(保留小数点后两位)。34 (1) 编写一个计算梯形面积的函数。函数头是:float area(float t,float b,float h)其中变量 t、b 和 h 分别表示梯形的上底、下底和高。 (2) 编写主函数从键盘输入梯形的上底、下底和高的值,调用上述函数输出梯形面积(保留小数点后两位) 。2007 年下半年全国自考(高级语言程序设计)真题试卷答案与解析一、单项选择题1 【正确答案】 D2 【正确答案】 A3 【正确答案】 C4 【正确答案】 D5 【正确答案】 C6 【正确答案】 B7 【正确答案】 D8 【正确答案】 B9 【正确答案】 B10

7、正确答案】 A11 【正确答案】 C12 【正确答案】 A13 【正确答案】 A14 【正确答案】 B15 【正确答案】 D二、填空题16 【正确答案】 117 【正确答案】 (x+sqrt(x+y)/(5*x)/2.0 或 1.0/2*(x+sqrt(x+y)/(5*x)18 【正确答案】 World19 【正确答案】 120 【正确答案】 MySun!21 【正确答案】 2422 【正确答案】 字符型指针或字符型地址23 【正确答案】 924 【正确答案】 325 【正确答案】 -20三、程序分析题26 【正确答案】 b=2 c=327 【正确答案】 6 8 1028 【正确答案】 8*

8、 3* 4* 1*29 【正确答案】 12四、程序填充题30 【正确答案】 num b bi31 【正确答案】 w ch fp32 【正确答案】 iN;i+) if(ai=0) sum=sum+ai: n+; if(n=0)printf(“All numbers are negative!n“); else aver=sum/n; printf(“aver=%7.2fn“,aver); 34 【正确答案】 #includestdio.b float area(float t,float b,float h) return(t+b)*h*0.5; main0 float t1,b1,h1; scanf(“%f%f%f“,&t1,&b1,&h1); printf(“area=%7.2fn“,area(t1,b1,h1) ;

展开阅读全文
相关资源
猜你喜欢
  • BS EN ISO 15882-2008 Sterilization of health care products - Chemical indicators - Guidance for selection use and interpretation of results《保健产品的消毒 化学指示剂 选择、使用和结果说明用指南》.pdf BS EN ISO 15882-2008 Sterilization of health care products - Chemical indicators - Guidance for selection use and interpretation of results《保健产品的消毒 化学指示剂 选择、使用和结果说明用指南》.pdf
  • BS EN ISO 15883-1-2009 Washer-disinfectors - General requirements terms and definitions and tests《洗涤消毒器 一般要求 术语 定义和试验》.pdf BS EN ISO 15883-1-2009 Washer-disinfectors - General requirements terms and definitions and tests《洗涤消毒器 一般要求 术语 定义和试验》.pdf
  • BS EN ISO 15883-2-2009 Washer-disinfectors - Requirements and tests for washer-disinfectors employing thermal disinfection for surgical instruments anaesthetic equipment bowls dish.pdf BS EN ISO 15883-2-2009 Washer-disinfectors - Requirements and tests for washer-disinfectors employing thermal disinfection for surgical instruments anaesthetic equipment bowls dish.pdf
  • BS EN ISO 15883-3-2009 Washer-disinfectors - Requirements and tests for washer-disinfectors employing thermal disinfection for human waste containers《洗涤消毒器 对人类废弃物容器进行热消毒的洗涤消毒器的试验和要.pdf BS EN ISO 15883-3-2009 Washer-disinfectors - Requirements and tests for washer-disinfectors employing thermal disinfection for human waste containers《洗涤消毒器 对人类废弃物容器进行热消毒的洗涤消毒器的试验和要.pdf
  • BS EN ISO 15883-4-2009 Washer-disinfectors - Requirements and tests for washer-disinfectors employing chemical disinfection for thermolabile endoscopes《清洗消毒器 不耐热内诊镜使用化学品消毒的清洗消毒器的试验.pdf BS EN ISO 15883-4-2009 Washer-disinfectors - Requirements and tests for washer-disinfectors employing chemical disinfection for thermolabile endoscopes《清洗消毒器 不耐热内诊镜使用化学品消毒的清洗消毒器的试验.pdf
  • BS EN ISO 15883-6-2015 Washer-disinfectors Requirements and tests for washer-disinfectors employing thermal disinfection for non-invasive non-critical medical devices and healthcar.pdf BS EN ISO 15883-6-2015 Washer-disinfectors Requirements and tests for washer-disinfectors employing thermal disinfection for non-invasive non-critical medical devices and healthcar.pdf
  • BS EN ISO 15883-7-2016 Washer-disinfectors Requirements and tests for washer-disinfectors employing chemical disinfection for non-invasive non-critical thermolabile medical devices.pdf BS EN ISO 15883-7-2016 Washer-disinfectors Requirements and tests for washer-disinfectors employing chemical disinfection for non-invasive non-critical thermolabile medical devices.pdf
  • BS EN ISO 15902-2005 Optics and photonics - Diffractive optics - Vocabulary《光学和光子学 衍射光学 词汇》.pdf BS EN ISO 15902-2005 Optics and photonics - Diffractive optics - Vocabulary《光学和光子学 衍射光学 词汇》.pdf
  • BS EN ISO 15912-2016 Dentistry Refractory investment and die material《牙科 耐火材料投资及模具材料》.pdf BS EN ISO 15912-2016 Dentistry Refractory investment and die material《牙科 耐火材料投资及模具材料》.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 大学考试

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