abcdefg#
abcdefg
abcdefg##
##
第1题:
在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为______。#include <stdio.h>main (){ char ch; while ((ch=getchar())!="\n") { if (ch>='A'&& ch<='B')ch=ch+32; else if (ch>='a'&& ch<='z')ch=ch-32; printf("%c",ch); } printf("\n");}
A.ABCdef
B.abcDEF
C.abc
D.DEF
第2题:
有以下程序:#include<stdio.h>#include<stdio.h>main() { char c[6]; int i=0; for(;j<6;c[i]=getchar(),i++); for(i=0;i<6;i++)putchar(c[i]); printf("\n");}如果从键盘上输入:ab<回车>c<回车>def<回车>则输出结果为 ______。
A.a b c d e f
B.a b c d
C.ab c d
D.abcdef
第3题:
当执行以下程序时,输入1234567890<回车>,则其中while循环体将执行【 】次。
include<stdio.h>
main()
{ char ch;
while((ch=getchar())=='0')prinft("");
}
第4题:
若程序执行时的输入数据是"2473",则下述程序的输出结果是 #include<stdio.h> void main() { int cs; while((cs=getchar())!=,'\n') {switch(cs='2') { case0 case 1:putchar(cs+4); case 2:putchar(cs+4); break; case 3:putchar(cs+3);default:putchar(cs+2);}}}
A.668977
B.668966
C.6677877
D.6688766
第5题:
有以下程序: #include <stdio.h> main() { int c; while((c=getchar() )! ='\n') { switch(c-'2') { case 0: case 1: putchar(c+4); case 2:putehar(c+4);break; case 3:putchar(c+3); default:putchar(c+2);break; } } } 运行程序,从第一列开始输入以下数据: 2473<回车>则程序的输出结果是( )。
A.668977
B.668966
C.66778777
D.6688766
第6题:
有以下程序: #include<stdio.h> main() { int c; while((c=getchar())!='\n') { switch(c-'2') { case 0: case 1:putchar(c+4); case 2:putchar(c+4);break; case 3:putchar(c+3); case 4:putchar(c+3);break;}} printf("\n")} 从第一列开始输入以下数据<CR>代表一个回车符。 2743<CR> 程序的输出结果是
A.66877
B.668966
C.6677877
D.6688766
第7题:
有以下程序 #include <stdio.h> main() {char c1,c2,c3,c4,c5,c6; scanf("%c%c%c%c",&c1,&c2,&c3,&c4); c5=getchar(); c6=getchar(); putchar(c1); putchar(c2); printf("%c%c\n",c5,c6); } 程序运行后,若从键盘输入 (从第1列开始) 123 <回车> 45678 <回车> 则输山结果是______。
A.1267
B.1256
C.1278
D.1245
第8题:
有以下程序: #include<stdio.h> main() { int c; while((c=getchar())!='\n') switch(c-'2') {case 1:putchar(c+4); case 2:putchar(c+4);break; case 3:putchar(c+4); case 4:putchar(c+4);break; } printf("\n"); } 输入以下数据,<CR>代表一个回车符, 2743<CR> 程序的输出结果是( )。
A.877
B.966
C.778
D.766
第9题:
Peachflower is pink.
Peachfloweris pink.
Peachflowerispink.
Peach flower is pink.
第10题:
#y#k#p#f
#wi#nd#
xj#oe
#2222#
第11题:
C##123#0
C##1230
C##0
C##123#\0
第12题:
abcdefg
bcdefgh$
bcdefgh$$
bcdefgh
第13题:
执行下面的程序时,输入abc<CR>(其中CR代表回车),输出结果是( )。 #include<stdio.h> #include <string.h> main() { char ch; while((cn=getchar())!='n') { switch(ch-'a') { case 0: putchar(ch+1); case 1:putchar(ch+1);break; case 2:putchar(ch+2); caSe 3:putchar(ch+2);break; } } }
A.abc
B.bbc
C.abcd
D.bbcee
第14题:
已知字符A的ASCII代码值为65,以下程序运行时,若从键盘输入:B33<回车>。则输出结果是______。 #include "stdio.h" main() { char a,b; a=getchar();scanf("Xd",&b); a=a-'A'+'0';b=b*2; printf("%c%c\n",a,b); }
A.2 B
B.1 B
C.3 B
D.4 B
第15题:
有以下程序: #include<stdio.h> main(){ char c[6]; int i=0; for(;i<6;c[i]=getchar(),i++); for(i=O;i<6;i++)putchar(c[i]); printf("\n"); } 如果从键盘上输入: ab<回车> c<回车> def<回车> 则输出结果为_______。
A.a
B.a
C.ab
D.abcdef b b c c c d d d e f
第16题:
下列程序运行时,若输入labcedf2df<回车>输出结果为【 】。
include<stdio.h>
main()
{ char a=0,ch;
while((ch==getchar())!='\n')
{ if(a%2!=0&&(ch>='a'&&ch<='z')) ch=ch'a'+'A';
a++;prtchar(ch);
}
printf("\n");
}
第17题:
当输入为"quert?"时,下面程序的执行结果是 #include<stdio.h> main() { char c; c=getchar(); while(c!='?') { putchar(c); c=getchar(); } }
A.quert
B.Rvfsu
C.quert?
D.rvfsu?
第18题:
有以下程序: #include<stdio.h> main() {int c; while((c=getchar())!='\n') {switch(c-'3') {case 0: case 1:putchar(c+4); case 2:putchar(c+4);break; case 3:putchar(c+3); case 4:putchar(c+3);break; }} printf("\n");} 从第一列开始输入数据(<CR>代表…个回车符):3845<CR>,则狴序输出结果为( )。
A.77889
B.77868
C.776810
D.7.78866e+007
第19题:
在执行以下程序时,如果从键盘上输入:ABCdef<回车>,则输出为______。 main() { char ch; while((ch=getchar())!='\n') { if(ch>='A' && ch<='Z') ch=ch+32; else if(ch>='a'&&ch<='2')ch=ch-32; printf("%c",ch); } printf("\n"); }
A.ABCdef
B.abcDEF
C.abc
D.DEF
第20题:
有以下程序 #include
第21题:
DCDC
DCBA
BABA
ABCD
第22题:
OPEN THE DOOR
OPEN tHE dOOR
open the door
Open The Door
第23题:
1234
4321
4444
1111