更多"当输入为'Fool&Swalow'时,下面程序的执行结果是( )。 "的相关试题:
[单项选择]当输入为"quert"时,下面程序的执行结果是
#include<stdio.h>
main( )
char c;
c=getchar( );
while(c!='')
putchar(c);
c=getchar( );
A. quert
B. Rvfsu
C. quert
D. rvfsu
[单项选择]当输入为”hello”时,下面程序的执行结果是( )。
# include<stdio.h>
main( )
char c;
c=getchar( );
while(c!='')
putchar(c);break;
A. Rvfsu
B. h
C. hello
[单项选择]若程序执行时的输入数据是"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
[单项选择]阅读下面程序,则执行后的结果是
#include "stdio.h"
main( )
char str[]="tomeetme",*p;
for(p=str;p<str+7;p+=2) putchar(*p);
printf("/n");
A. tomeetme
B. tmem
C. oete
D. tome
[单项选择]若执行下面的程序时,从键盘输入5和2,则输出结果是( )。
#include <stdio.h>
main( )
int a, b, k;
scan("%d, %d", &a, &b);
k=a;
if(a<b) k=a%b;
else k=b%a;
printf("%d/n",k);
A. 5
B. 3
C. 2
D. 0
[单项选择]阅读下面程序,则执行后的结果是()
#include "stdio, h"
main( )
char str[]="tomeetme", *p;
for(p=str; p<str+7; p+=2)putchar(*p);
printf("/n");
A. tomeetme
B. tmem
C. oete
D. tome
[填空题]阅读下面程序段,则执行后输出的结果是 。
#include "stdio.h"
main( )
char fun(char,int);
char a=’A’;
int b=13;
a=fun(a,b);
putchar(a);
char fun(char a,int b)
char k;
k=a+b;
return k;
[单项选择]执行以下程序时输入1234567<CR>,则输出结果是
#include <stdio.h>
main( )
int a=1,b;
scanf("%3d%2d",&a,&b);
printf("%d%d/n",a,b);
A. 12367
B. 12346
C. 12312
D. 12345
[填空题]
执行以下程序时输入1234567<CR>,则输出结果是 【6】 。
#include <stdio.h>
main( )
{ int a=1,b;
scanf("%2d%2d",&a,&b); prinff("%d %dhn",a,b);
}
[单项选择]运行下面程序时,从键盘输入字母H,则输出结果是( )。
#include<stdio.h>
main( )
char ch;
ch=getchar( );
switch(ch)
case 'H':printf("Hello!/n");
case 'G':printf("Good morning!/n");
default:printf("Bye_Bye!/n");
A. Hello!
B. Hello!
C. Hello!
D. Hello!
[单项选择]下面程序的输出结果是
#include<stdio.h>
#include<string.h>
main( )
char*p1="abc",*p2="ABC",str[50]="xyz";
strcpy(str+2,streat(p1,p2));
printf("%s/n",str);
A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
[单项选择]下面程序的运行结果是
#include<stdio.h>
#include<string.h>
main( )
char*s1="AbDeG";
char*s2="AbdEg";
s1+=2;s2+=2;
printf("%d/n",strcmp(s1,s2));
A. 正数
B. 负数
C. 零
D. 不确定的值
[填空题]阅读下面程序,则执行后的输出结果是______。
#include"stdio.h"
main( )
int x,y,z;
x=1;y=2;z=3;
if(x>y)if(x>z)printf("%d",x);
else printf("%d",y);
printf("%d/n",z);
[单项选择]下面程序的输出结果是( )。
#include<stdio.h>
#include<string.h>
main( )
char pl[20]="123 ", *p2="ABC ", str[50]="xyz";
strcpy(str+2, strcat(p1, p2) );
printf("%s/n", str);
A. xyzabzac
B. bAcBACBC
C. xy123ABC
D. yz123ABC
[单项选择]下面程序的输出结果是( )。
#include <stdio.h>
#include <string>
void main( )
char s1[50]="some string*",s2[]="test";
printf("%s/n", strcat(s1,s2));
A. some string*
B. test
C. some stritest
D. some string *test