更多"下列程序输出的结果是( )。 #include<stdio.h> "的相关试题:
[单项选择]下列程序输出的结果是( )。 #include<stdio.h> un1(char a,char b){char c;c=a;a=b;b=c;} fun2(char*a,char b){char c;c=*a;*a=b;b=c;} fun3(char*2,char*b){charc;c=*a;*a=*b;*b=c;} void main( ) { char a,b; a=’A’;b=’B’;funl(a,b);putchar(a);putchar(b); a=’A’;b=’B’;fun2(&a,b);putchar(a);putchar(b); a=’A’;b=’B’;fun3(&a,&b);putchar(a);putchar(b); putchar(’/n’); }
A. BABBAB
B. ABBBBA
C. ABBABA
D. ABABBA
[填空题]以下程序运行后的输出结果是_________。
#include
char *ss(char *s)
{ char *p,t;
p=s+1;t=*s;
while(*p) {*(p-1)=*p; p++;}
*(p-1)=t;
return s;
}
main( )
{ char *p,str[10]="abcdefgh";
p=ss(str);
printf("%s/n",p);
}
[填空题]以下程序运行后的输出结果是______。
#include
char*ss(char*s)
char*p,t;
P=s+1;t=*s;
while(*p) *(p-1)=*p;p++;
*(p-1)=t;
return s;
main( )
char*p,str[10]="abcdefgh";
p=ss(str);
printf("%s/n",p);
[单项选择]下列程序的输出结果是 #include void main( )
{ char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++) switch(str[i]) {
case’1’:x4++; case’2’:x3++; case’3’:x2++;
case’4’:x1++; } cout < < x1 < < ","
< < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
sub1(char a,char b) char c:c=a:a=b:b=c;
sub2(char*a,char b) char c:c=*a;”a=b;b=c;
sub3(char*a,char*b) char c;c=*a;”a=*b;*b=c;
void main( )
char a,b;
a=’A’;b=’B’:sub1(a,b);putchar(a):putchar(b):
a=’A’;b=’B’; sub2(&a,b);putchar(a);putchar(b);
a=’A’;b=’B’; sub3(&a,&b);putchar(a);putchar(b);
putchar(’/n’);
A. ABABAB
B. ABBBBA
C. ABBABA
D. ABABBA
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
fun1(char a,char b) char c;c=a;a=b;b=c;
fun2(char*a,char b) char c;c=*a;*a=b;b=c;
fun3(char*a,char*b) char c;c=*a;*a=*b;*b=c;
void main( )
char a,b;
a=’A’;b=’B’; fun1 (a,b);putchar(
A. ;putchar(
B. ;
[单项选择]下列程序的输出结果是
#include
void main( )
char * str="12123434";
int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++)
switch(str[i])
case’1’:x4++;
case’2’:x3++;
case’3’:x2++;
case’4’:x1++;
cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
funl(char a,char b)char c;c=a;a=b;b=c;
fun2(char *a,char b)char c;c=*a;*a=b;b=c;
fun3(char *a,char *b)char c;c=*a;*a=*b;*b=c;
void main( )
char a,b;
a=’A’;b=’B’;fun1(a,b);putchar(a);putchar(b);
a=’A’;b=’B’;fun2(&a,b);putchar(a);putchar(b);
a=’A’;b=’B’;fun3(&a,&b);putchar(a);putchar(b);
putchar(’/n’);
A. BABBAB
B. ABBBBA
C. ABBABA
D. ABABBA
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
subl(char a,char b) char c;c=a;a=b;b=c;
sub2(char*a,char b) char c;c=*a;*a=b;b=c;
sub3(char*a,char*b) char c;c=*a;*a=*b;*b=c;
void main( )
char a,b;
a=’A’;b=’B’;subl(a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub2(&a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub3(&a,&b);putchar(a);putchar(b);
putchar(’/n’);
A. BABBAB
B. ABBBBA
C. ABBABA
D. ABABBA
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
sub1(char a,char b) char c;c=a;a=b;b=c:
sub2(char*a,charb) charc;c=*a;”a=b:b=c;
sub3(char*a,char*b) char c;c=*a;”a=*b;*b=c:
void main( )
char a,b;
a=’A’;b=’B’;sub1(a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub2(&a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub3(&a,&b);putchar(a);putchar(b):
putchar(’/n’);
A. ABABAB
B. ABBBBA
C. ABBABA
D. ABABBA
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
fun1(char a,char b)char c;c=a;a=b;b=c;
fun2(char*a,char b)char c;c=*a;*a=b;b=c;
fun3(char*a,char*b)char c;c=*a;*a=*b;*b=c;
void main( )
char a,b;
a=’A’;b=’B’;fun1(a,b);putchar(
A. ;putchar(
B. ;