随机组卷按大纲配比:判断 8 · 单选 20 · 填空 10 · 综合 2(共 40 题 · 80 分)
- 单选为了避免在嵌套的条件语句if...else中产生二义性,C语名规定,else子句总与()配对做这题 →
- 单选设有一分段函数,则下列程序段哪个是正确的____。 { \begin{array}{l l} {x=1} & { a=b} \end{array} .做这题 →
- 填空C 语言中,运行下列程序后,输出结果为 #include<stdio.h> int main(){ int i=2; switch(i){ case 0:i+=1; case 2:i+=1; default:i+=1; } printf("%d)n",i); return 0; }做这题 →
- 填空在 C 语言中,运行下列程序后,输出结果为____。 #include<stdio.h> int main (void){ int a=1,b=2,c=3; if(a=b) printf("%d",c); else printf("%d",b); return 0; }做这题 →
- 填空在使用 switch 语句时,在 case 后的各常量表达式的值____(能/不能)相同.做这题 →
- 填空在使用 switch 语句时,各 case 和 default 子句的先后顺序____变动,则程序执行结果不会受到影响。做这题 →
- 填空#include main() { int p,a=5; if(p=a!=0) printf("%d\n",p); else 运行结果为: printf("%d\n",p+2); }做这题 →
- 填空请给出下列 C 语言的程序输出结果是 ____。 c #include void main() { int a=1,b=2,c=3; if(c=a) printf("%d\n",c); else printf("%d\n",b); }做这题 →
- 填空61 若运行时输入:16<CR>,则以下程序的运行结果是______。 #include <stdio.h> void main(void) {int year; printf("Input your year:"); scanf("%d",&year); if (year>=18) printf("your \4.5 yuan/xiaoshi"); else printf("your \3.0 yuan/xiaoshi"); }做这题 →
- 填空62 若运行时输入:2<CR>,则以下程序的运行结果是______。 #include <stdio.h> void main(void) {char class; printf("Enter 1 for 1st class post or 2 for 2nd post"); scanf("%c",&class); if (class=='1') printf("1st class postage is 19p"); else printf("2nd class postage is 14p"); }做这题 →
- 填空63 若运行时输入:4.4<CR>,则以下程序的运行结果是______。 #include <stdio.h> void main(void) {float costprice,sellingprice; printf("Enter Cost Price \:"); scanf("%f",&costprice); if(costprice>=5) {sellingprice=costprice+costprice*0.25; printf("Selling Price(0.25)%6.2f",sellingprice); } else {sellingprice=costprice+costprice*0.30; printf("Selling Price(0.30)%6.2f",sellingprice); } }做这题 →
- 填空74以下程序的运行结果是______。 main() {int a,b,c,d; a=c=0; b=1; d=20; if(a) d=d-10; else if(!b) if(!c) d=15; else d=25; printf("%d\n",d); }做这题 →
- 填空108 若运行时输入:3 5/<CR>,则以下程序的运行结果是______。 main() {float x,y; char o; double r; scanf("%f %f %c",&x,&y,&o); switch(o) {case '+':r=x+y;break; case '-':r=x-y;break; case '*':r=x*y;break; case '/':r=x/y;break; } printf("%f",r); }做这题 →
- 填空txt 若有以下代码: main{ int x = 1, a = 0, b = 0; switch(x) { case 0: b++; case 1: a++; case 2: a++; b++; } printf("a = %d, b = %d\n", b, a); }做这题 →
- 填空若有以下代码: txt main{ int x =1, a=0,b=0; switch(x){ case 0: b++; case 1: a++; case 2:a++;b++; } printf("a=%d,b=%d\n",b,a); }做这题 →
- 填空已有定义 "int x = 0, y = 1, z = 2; ", 执行语句 "if (x > 0 && ++ y > 0) z++; else z--; "后,变量 x, y, z 的值分别是 ____。做这题 →
- 填空C语言中的三种基本结构包括____、____和____。做这题 →
- 填空写出下列程序的输出结果。 c #include main(){ int i=10; switch (i){ case 9: i+=1; case 10: i+=2; case 11: i+=3; default: i+=4; } printt("i=%d\n",i); }做这题 →
- 填空有程序片段: txt int score; scanf("%d",&score); if(score >60)printf("passed."); if(score >80)printf("nice."); 程序运行时,若用户输入90,屏幕输出为____。做这题 →
- 填空C 语言中, 运行下列程序后, 输出结果为 ____. #include<stdio.h> javascript int main(){ int i=2; switch(i){ case 0:i+=1; case 2:i+=1; default:i+=1; } printf("%d)n",i); return 0;做这题 →
- 填空有程序片段: int score; scanf("%d",&score); if(score >60)printf("passed."); if(score >80)printf("nice."); 程序运行时,若用户输入90,屏幕输出为____。做这题 →
- 填空下列程序段的输出结果是 [8]。 txt int n='c'; switch (n++) { default: printf ("error");break; case 'a': case 'A': case 'b': case 'B': printf ("good"); break; case 'c': case 'C': printf ("pass"); case 'd': case 'D': printf ("warn"); }做这题 →
- 填空下面程序是判断一元二次方程 ax^{2}+bx+c=0 根的情况。 c #include int main(void){ float a, b, c, disc; scanf("a=%f,b=%f,c=%f",&a,&b,&c); delta=b*b-4*a*c; if(__________) printf("该方程有两个相等的实根。\n"); else if(__________) printf("该方程有两个不相等的实根。\n"); ____ printf("该方程没有实根。\n"); return 0; } 一元二次方程△=b*b-4*a*c △>0时,方程有2个不相等的实根; △=0时,方程有两个相等的实根; △0_, _else_。 if(条件1为真)执行操作1; else if(条件2为真)执行操作2; else if(条件3为真)执行操作3; ...... else 执行操作n;做这题 →
- 填空程序填空题。根据输入字符的 ASCII 码来判别大写字符、小写字符、数字及其他字符。 c #include int main(void){ char c; printf("\n Please input a character;\n"); c=getchar(); ________ printf(" It is a capital letter! \n"); ________ printf(" It is a lower letter! \n"); ________ printf(" It is a digit! \n"); else printf(" It is other character! \n"); return 0; }做这题 →
- 单选36 下面程序的功能是计算1至50中是7的倍数的数值之和,请选择填空。 #include<stdio.h> main() {int i,sum=0; for(i=1;i<=50;i++) if( _【1】_ )sum+=i; printf("%d",sum); }做这题 →
- 单选关于语句 int x; scanf("%d", &x); if(x=0) printf("zero"); 下列说法正确的是 ( )。做这题 →
- 综合下面程序的功能是实现表达式 z = (x >= y ? x : y),请将程序填写完整。 c include"stdio.h" main( ){ int x, y, z; printf("Please input x,y:"); scanf("%d%d",&x,&y); if (__________) z=x; else z=y; printf("z=%d",z); }做这题 →
- 综合输入一个年份,判断是否为闰年。 #include<stdio.h> int main(){ int month; printf("Pleaseinputamonth:"); scanf("%d",&month); if(_________||(month%400==0)) printf("%d年是闰年!\n",month); else printf("%d年不是闰年!\n",month); return 0; }做这题 →
- 单选对于 “if(表达式)语句”,以下叙述正确的是()做这题 →
- 单选为了避免在嵌套的条件语句if-else的二义性,C语言规定:else总是与之配对的if是()做这题 →
- 综合有以下程序 c #include main(){ int a=2, b=1; if(!a) b++; else if(a==0) if(a) b+=2; else b+=3; printf("%d\n", b); } 程序运行后的输出结果是____。做这题 →
- 综合有以下程序 txt void f(int v, int w){ int t; t=v; v=w; w=t;} main(){ int x=5,y=7,z=6; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf("%d,%d,%d\n",x,y,z); } 执行后输出结果____。做这题 →
- 综合下面程序的功能是实现表达式 z = (x >= y ? x : y),请将程序填写完整。 include"stdio.h" main( ){ int x, y, z; printf("Please input x,y:"); scanf("%d%d",&x,&y); if (__________) z=x; else z=y; printf("z=%d",z); }做这题 →
- 综合写出下列程序的运行结果。 c #include void main() { int a=5,b=4,c=3,d=2; if(a>b>c) printf( "%d\n" ,d); else if((c-1>=d)==1) printf( "%d\n" ,d+1); else printf( "%d\n" ,d+2); } 程序执行后的输出结果是:____。 seal 闫 TONGFANG做这题 →
- 单选if 语句的基本形式是:if(表达式)语句,以下关于“表达式”值的叙述中正确的是()做这题 →
- 单选设有定义: int a=1, b=2, c=3; 以下语句中执行效果与其它三个不同的是 ( )做这题 →
- 单选以下程序段中, 与语句: k = a > b? (b > c? 1: 0): 0; 功能相同的是 ( )做这题 →
- 单选若有定义语句 int a,b;double x;则下列选项中没有错误是() txt做这题 →
- 单选下列选项中, 能够满足 “若字符串 s1 等于字符串 s2, 则执行 ST” 要求的是 ( )做这题 →
- 综合(判断)if-else 语句允许嵌套吗?做这题 →
- 综合if 中的内嵌语句可以是什么?做这题 →
- 判断在C语言中,if语句后的一对圆括号中,用以决定分支流程的表达式只能用逻辑表达式或关系表达式。做这题 →
- 判断在 switch 语句中,每一个 case 的常量表达式的值必须不同。做这题 →
- 判断switch 语句中,case 语句后如没有 break,则顺序向下执行。做这题 →
- 判断在C语言语句中,用来决定分支流程的表达式是可用任意表达式。做这题 →
- 判断在 switch 语句中,每一个的 case 常量表达式的值不可以相同,可以为字符串常量。做这题 →
- 判断在 switch 语句中,多个 case 可以共用一组执行语句。做这题 →
- 判断switch语句中必须有break语句,否则无法退出switch语句。()做这题 →
- 判断C 语言中条件选择结构 if 中可以嵌套重复结构 while。做这题 →
- 填空有以下程序: c #include main(){ int a=0, b=1,c=-1; if(a) b++; else if(a==0) if(b==0)c++; else c++; printf("%d\n", ~c); system("pause"); printf("\n"); } 则程序运行后输出的结果()做这题 →