[计算机类试卷]国家二级C语言机试(顺序结构程序设计)模拟试卷1(无答案).doc

上传人:fuellot230 文档编号:846928 上传时间:2019-02-21 格式:DOC 页数:13 大小:41KB
下载 相关 举报
[计算机类试卷]国家二级C语言机试(顺序结构程序设计)模拟试卷1(无答案).doc_第1页
第1页 / 共13页
[计算机类试卷]国家二级C语言机试(顺序结构程序设计)模拟试卷1(无答案).doc_第2页
第2页 / 共13页
[计算机类试卷]国家二级C语言机试(顺序结构程序设计)模拟试卷1(无答案).doc_第3页
第3页 / 共13页
[计算机类试卷]国家二级C语言机试(顺序结构程序设计)模拟试卷1(无答案).doc_第4页
第4页 / 共13页
[计算机类试卷]国家二级C语言机试(顺序结构程序设计)模拟试卷1(无答案).doc_第5页
第5页 / 共13页
点击查看更多>>
资源描述

1、国家二级 C 语言机试(顺序结构程序设计)模拟试卷 1(无答案)一、选择题1 设有定义:double x=2.12; ,以下不能完整输出变量 x 值的语句是( )。(A)printf(“x=%5.0fn“,x);(B) printf(“x=%fn“,x);(C) printf(“x=%lfn“,x);(D)printf(“x=%0.5fn“,x);2 设有定义:int a,b; float x,y; ,则以下选项中对语句所作的注释叙述错误的是( )。(A)scanf(“%d%d%f“, /* 多余的格式符%f 完全不起作用 */(B) scanf(“%d%d“, /* 多余的输入项不能获得输入

2、数据 */(C) scanf(“%d%f%d“, /* 输入项与格式符类型不匹配,变量 b 和 x 得不到正确的输入数据 */(D)scanf(“Input:%d%d“, /* 格式串中允许加入格式符以外的字符串 */3 有以下程序#include main() char a,b,c,d;scanf(“%c%c“,c=getchar();d=getchar();printf(“%c%c%c%cn“,a,b,c,d);当执行程序时,按下列方式输入数据(从第 1 列开始,代表回车,注意:回车也是一个字符)1234则输出结果是( )。(A)12 3(B) 12(C) 1234(D)12344 有以下

3、程序#include main() int a=1,b=0;printf(“%d,“,b=a+b);printf(“%dn“,a=2*b);程序运行后的输出结果是( )。(A)1,2(B) 1,0(C) 3,2(D)0,05 若变量已正确定义为 int 型,要通过语句scanf(“%d,%d,%d“, 给 a 赋值 1、给 b 赋值 2、给 c 赋值 3,以下输入形式中错误的是(注: 代表一个空格符)( )。(A)123(B) 1,2,3 (C) 1,2,3(D)1,2,36 设变量均已正确定义,若要通过scanf(“%d%c%d%c“,语句为变量 a1 和 a2 赋数值 10 和 20,为变

4、量 c1 和 c2 赋字符 X 和 Y。以下所示的输入形式中正确的是(注:代表空格字符)( )。(A)10X20Y(B) 10X20Y(C) 10X20Y(D)10X20Y7 设有定义:int a; float b;执行 scanf(“%2d%f“, 语句时,若从键盘输入876 543.0则 a 和 b 的值分别是( )。(A)87 和 6.0(B) 876 和 543.0(C) 87 和 543.0(D)76 和 543.08 有如下程序段:int x=12; double y=3.141593; printf(“%d%8.6f“, x, y); 其输出结果是( )。(A)123.14159

5、3(B) 12 3.141593(C) 12, 3.141593(D)123.14159309 若有定义:int a,b;通过语句scanf(“%d;%d“,能把整数 3 赋给变量 a, 5 赋给变量 b 的输入数据是( )。(A)3;5(B) 3,5(C) 3 5(D)3510 若有定义int a;float b;double c;程序运行时输入:3 4 5能把值 3 输入给变量 a、 4 输入给变量 b、5 输入给变量 c 的语句是( )。(A)scanf(“%d%f%lf“, (B) scanf(“%d%lf%lf“, (C) scanf(“%d%f%f“, (D)scanf(“%lf%

6、lf%lf“, 11 设有定义:double a,b,c;若要求通过输入分别给 a、b、c 输入 1、2、3,输入形式如下(注:此处 代表一个空格)1.02.03.0则能进行正确输入的语句是( )。(A)scanf(“%lf%lf%lf“,(B) scanf(“%lf%lf%lf“,a,b,c);(C) scanf(“%f%f%f“,(D)scanf(“%5.1lf%5.1lf%5.1lf“,12 以下叙述中正确的是( )。(A)赋值语句是一种执行语句,必须放在函数的可执行部分(B) scanf 和 printf 是 C 语言提供的输入和输出语句(C)由 printf 输出的数据都隐含左对齐(

7、D)由 printf 输出的数据的实际精度是由格式控制中的域宽和小数的域宽来完全决定的13 以下叙述中正确的是( )。(A)当用 scanf 从键盘输入数据时,每行数据在没按下回车键(Enter 键) 前,可以任意修改(B)花括号对只能用来表示函数的开头和结尾,不能用于其他目的(C)空语句就是指程序中的空行(D)复合语句在语法上包含多条语句,其中不能定义局部变量14 以下叙述中正确的是( )。(A)在 scanf 函数中的格式控制字符串是为了输入数据用的,不会输出到屏幕上(B)在使用 scanf 函数输入整数或实数时,输入数据之间只能用空格来分隔(C)在 printf 函数中,各个输出项只能是

8、变量(D)使用 printf 函数无法输出百分号 %15 以下叙述中正确的是( )。(A)在 scanf 函数的格式串中,必须有与输入项一一对应的格式转换说明符(B)只能在 printf 函数中指定输入数据的宽度,而不能在 scanf 函数中指定输入数据占的宽度(C) scanf 函数中的字符串,是提示程序员的,输入数据时不必管它(D)复合语句也被称为语句块,它至少要包含两条语句16 有以下程序#include main()int a=2, c=5; printf( “a=%d,b=%dn“, a,c );程序的输出结果是( )。(A)a=%d,b=%d(B) a=%2,b=%5(C) a=2

9、,b=5(D)a=%d,b=%d17 若有定义和语句:int a, b;scanf(“%d,%d,“, 以下选项中的输入数据,不能把值 3 赋给变量 a、5 赋给变量 b 的是( )。(A)3 ,5(B) 3,5(C) 3,5,(D)3,5,418 有以下程序#include main() int k=33; printf(“%d,%o,%xn“, k, k, k);程序的运行结果是( )。(A)33,41,21(B) 33,33,33(C) 41,33,21(D)33,21,4119 若有定义:char c; int d; ,程序运行时输入: 1,2 ,能把值 1 输入给变量c、值 2 输入

10、给变量 d 的输入语句是( )。(A)scanf(“%c,%d“, (B) scanf(“%c%d“, (C) scanf(“%d,%f“, (D)scanf(“%d%d“, 20 有以下程序#include main() int k=-17; printf(“%d,%o,%xn“, k, 1-k, 1-k);程序的运行结果是( )。(A)-17,22,12(B) -17,12,22(C) -17,-22,-12(D)17,22,1221 若有定义:int a; float b; double c; ,程序运行时输入:a=1,b=2,c=3 ,能把值 1 输入给变量 a、值 2 输入给变量 b

11、、值 3 输入给变量 c 的输入语句是( )。(A)scanf(“a=%d,b=%f,c=%lf“, (B) scanf(“%d%f%lf“, (C) scanf(“a=%d,b=%lf,c=%lf“, (D)scanf(“a=%d,b=%f,c=%f“, 22 有以下程序#include main()int a=2, c=5;printf(“a=%d,b=%dn“, a, c );程序运行后的输出结果是( )。(A)a=%d,b=%d(B) a=%2,b=%5(C) a=%d,b=%d(D)a=2,b=523 有以下程序#include main() int a1,a2; char c1,c

12、2;scanf(“%d%c%d%c“,printf(“%d,%c,%d,%c“,a1,c1,a2,c2);若想通过键盘输入,使得 a1 的值为 12,a2 的值为 34,c1 的值为字符 a,c2 的值为字符 b,程序输出结果是:12,a,34,b 则正确的输入格式是 (以下 代表空格,代表回车)( )。(A)12a34b(B) 12a34b(C) 12,a,34,b(D)12a34b24 以下不能输出字符 A 的语句是(注:字符 A 的 ASCII 码值为 65,字符 a 的ASCII 码值为 97)( )。(A)printf (“%d n“, A);(B) printf (“%c n“,

13、a-32);(C) printf (“%c n“, 65);(D)printf (“%c n“, B-1);25 有以下程序#include main() char c1,c2,c3,c4,c5,c6;scanf(“%c%c%c%c“, c5=getchar(); c6=getchar();putchar(c1); putchar(c2);printf(“%c%cn“,c5,c6);程序运行后,若从键盘输入(从第 1 列开始) 12345678则输出结果是( )。(A)1245(B) 1256(C) 1278(D)126726 以下能正确输出字符 a 的语句是( )。(A)printf(“%s

14、“, “a“);(B) printf(“%s“, a);(C) printf(“%c“, “a“);(D)printf(“%d“, a);27 以下不能输出小写字母 a 的选项是( )。(A)printf(“%cn“,“a“);(B) printf(“%cn“,A+32);(C) putchar(97);(D)putchar(a);28 有以下程序段char c1,c2,c3;scanf(“%c%c%c“, 若要给 c1、c2、c3 分别输入字母 A、B、C,则以下对输入形式的描述正确的是( )。(A)字母 A、B、C 之间不能有分隔符(B)字母 A、B 、C 之间可以用空格分隔(C)字母 A

15、、B 、C 之间可以用回车符分隔(D)字母 A、B、C 之间可以用 Tab 键分隔29 设有定义:char s81; int i=0;以下不能将一行(不超过 80 个字符)带有空格的字符串正确读入的语句或语句组是( )。(A)scanf(“%s“,s);(B) while(si+=getchar()!=n);si=0;(C) gets(s);(D)do scanf(“%c“, while(si+!=n); si=0;30 有以下程序段#include int j; float y;char name50;scanf(“%2d%f%s“, 当执行上述程序段,从键盘上输入 55566 7777ab

16、c 后,y 的值为( )。(A)566.0(B) 55566.0(C) 7777.0(D)566777.031 有以下程序段char name20;int num;scanf(“name=%s num=%d“,name, 当执行上述程序段,并从键盘输入:name=Lili num=1001后,name 的值为( )。(A)Lili(B) name=Lili(C) Lili num=(D)name=Lili num=100132 以下正确的字符串常量是( )。(B) abc(C) Olympic Games(D)33 以下语句的输出结果是printf(“%dn“, strlen(“t“065xffn“);( )。(A)5(B) 8(C) 14(D)输出项不合法,无正常输出34 有如下程序#include #include main() printf(“%dn“, strlen(“0n0111“);程序运行后的输出结果是( )。(A)6(B) 8(C) 9(D)4

展开阅读全文
相关资源
猜你喜欢
  • EJ T 1027 12-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure qualification of austenitic stainless steel《压水堆核电厂核岛机械设备焊接规范 奥氏体不锈钢焊接工艺评定》.pdf EJ T 1027 12-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure qualification of austenitic stainless steel《压水堆核电厂核岛机械设备焊接规范 奥氏体不锈钢焊接工艺评定》.pdf
  • EJ T 1027 13-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure qualification of heterogeneous steel《压水堆核电厂核岛机械设备焊接规范 异种钢焊接工艺评定》.pdf EJ T 1027 13-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure qualification of heterogeneous steel《压水堆核电厂核岛机械设备焊接规范 异种钢焊接工艺评定》.pdf
  • EJ T 1027 14-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure quelification of anticorrosion overlaying with austenitic stainless steel《压水堆核电厂核岛.pdf EJ T 1027 14-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure quelification of anticorrosion overlaying with austenitic stainless steel《压水堆核电厂核岛.pdf
  • EJ T 1027 15-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure qualification of anticorrosion overlaying with nickel-base alloy《压水堆核电厂核岛机械设备焊接规范 .pdf EJ T 1027 15-1996 Welding code for mechanical components of PWR nuclear islands Welding procedure qualification of anticorrosion overlaying with nickel-base alloy《压水堆核电厂核岛机械设备焊接规范 .pdf
  • EJ T 1027 16-1996 Welding code for mechanical components of PWR nuclear islands Hardfacing procedure qualification on valve《压水堆核电厂核岛机械设备焊接规范 阀门耐磨堆焊工艺评定》.pdf EJ T 1027 16-1996 Welding code for mechanical components of PWR nuclear islands Hardfacing procedure qualification on valve《压水堆核电厂核岛机械设备焊接规范 阀门耐磨堆焊工艺评定》.pdf
  • EJ T 1027 17-1996 Welding code for mechanical components of PWR nuclear islands Procedure qualification of repair welding for weld defects《压水堆核电厂核岛机械设备焊接规范 焊接缺陷补焊的工艺评定》.pdf EJ T 1027 17-1996 Welding code for mechanical components of PWR nuclear islands Procedure qualification of repair welding for weld defects《压水堆核电厂核岛机械设备焊接规范 焊接缺陷补焊的工艺评定》.pdf
  • EJ T 1027 18-1996 Welding code for mechanical components of PWR nuclear islands Specification for equiapment production workshops《压水堆核电厂核岛机械设备焊接规范 设备制造车间的技术要求》.pdf EJ T 1027 18-1996 Welding code for mechanical components of PWR nuclear islands Specification for equiapment production workshops《压水堆核电厂核岛机械设备焊接规范 设备制造车间的技术要求》.pdf
  • EJ T 1027 19-1996 Welding code for mechanical components of PWR nuclear islands Qualification of welders and operators《压水堆核电厂核岛机械设备焊接规范 手焊工和焊接操作工的资格评定》.pdf EJ T 1027 19-1996 Welding code for mechanical components of PWR nuclear islands Qualification of welders and operators《压水堆核电厂核岛机械设备焊接规范 手焊工和焊接操作工的资格评定》.pdf
  • EJ T 1027 2-1996 Welding code for mechanical components of PWR nuclear islands Qualification of welding materials《压水堆核电厂核岛机械设备焊接规范 焊接材料的评定》.pdf EJ T 1027 2-1996 Welding code for mechanical components of PWR nuclear islands Qualification of welding materials《压水堆核电厂核岛机械设备焊接规范 焊接材料的评定》.pdf
  • 相关搜索

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

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