2022年湖北省荆州市全国计算机等级考试C语言程序设计知识点汇总卷(含答案).docxVIP

  • 2
  • 0
  • 约1.92万字
  • 约 38页
  • 2023-06-30 发布于北京
  • 举报

2022年湖北省荆州市全国计算机等级考试C语言程序设计知识点汇总卷(含答案).docx

2022年湖北省荆州市全国计算机等级考试C语言程序设计知识点汇总卷(含答案) 学校:________ 班级:________ 姓名:________ 考号:________ 一、单选题(20题) 1. 有下列程序:? int funl(double a){return a*=a;}? int fun2(double x,double y) {double a=0,b=0;? a=funl(x);b=funl(y);return(int)(a+b);? } main(  ) {double w;w=fun2(1.1,2.0),……} 程序执行后变量w中的值是(  )。 、? A.5.21 B.5 C.5.0 D.0.0? 2.下面的哪个保留字不能作为函数的返回类型()。 A.void B.int C.new D.long? 3.设有定义“double a[10],*s=a;”,以下能够代表数组元素a[3]的是()。 A.(*s)[3] B.*(s+3) C.*s[3] D.*s +3? 4.数据字典(DD)所定义的对象都包含于(  )。 A.软件结构图 B.方框图 C.数据流图(DFD图) D.程序流程图? 5.有以下函数: int fun(char *x, char *y) {int n=0;} while((*x==*y)*x!=‘\0’) {x++; y++; n++; } return n; } 函数的功能是()。 A.将y所指字符串赋给x所指存储空间? B.查找x和y所指字符串中是否有‘\0’? C.统计x和y所指字符串中最前面连续相同的字符个数? D.统计x和y所指字符串中相同的字符个数? 6. 7.有以下程序: #include <stdio.h> main() {FILE *pf; char *s1=“China”, *s2=“Beijing”; pf=fopen(“abc. dat”, “wb+”); fwrite(s2,7,1,pf); rewind(pf); / *文件位置指针回到文件开头* / fwrite(s1,5,1 ,pf); fclose( pf); } 程序执行后,abc. dat文件的内容是()。 A.China B.Chinang C.ChinaBeijing D.BeijingChina? 8.设S为C语言的语句,计算机执行下面算法时,算法的时间复杂度为()。 A.n2 B.O(nlgn) C.O(n) D.O(n2)? 9.有以下程序: #includestdio.h main(  ) {unsigned char a=8,C; C=a3: printf(%d\n,c); } 程序运行后的输出结果是(  )。A.32 B.16 C.1 D.0? 10. 11.有以下程序: #include <stdio.h> int fun (int x, int y ) {if (x!=y) return ( (x+y)/2 ); else return (x); } main() {int a=4, b=5, c=6; printf(“%d\n”, fun(2*a, fun(b, c))); } 程序运行后的输出结果是()。 A.3 B.6 C.8 D.12? 12.? 下列程序的输出结果是( )。 #includestdio.h main { int a[2][3]={{1,2,3),{4,5,6)),(*p)[3],i; p=a ; for(i=0;i3;i++) { if(i2) p[1][i]=p[1][i]-1; else p[1][i]=1; } printf(%d\n,a[o][1]+a[1][1]+a[1][2]); } A.8 B.7 C.12 D.9? 13.有以下程序: #include <stdio.h> main() { int m=1,n=2, *p=m, *q=n, *r; r=p; p=q; q=r; printf(“%d,%d,%d,%d\n”, m,n,*p,*q); } 程序的运行结果是()。 A.2,1,1,2 B.1,2,1,2 C.2,1,2,1 D.1,2,2,1? 14.有以下程序: #includestdio.h void fun(char*C,int d) {*c=*c+1,d=d+1;  printf(%c%,c,*c,d); } main(  ) {char b=aa=A;  fun(b,a);printf(%c,%c\n,b,a); ) 程序运行后的输出结果是(  )。A.b,B,b,A B.b,B,B,A C.a,B,B,a D.a,B,a,B? 15.设有两个串p和q,求q在p中首

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档