下面程序的输出是______。 fun(char *s,int p1,int p2) { char c; while(p1<p2) { c=s[p1];s[p1]=s[p2];s[p2]=c;p1++;p2--;} } main() { char a[]="ABCDEFG",k,*p; fun(a,0,2);fun(a,4,6); printf("%s\n ",a); }
A.ABCDEFG
B.DEFGABC
C.GFEDCBA
D.CBADGFE
第1题:
有以下程序
#include<stdio.h>
#include<string.h>
void fun(char *w,int m)
{ char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1<p2){s=*p1;*p1=*p2;*p2=s;p1++;p2--;}
}
main()
{ char a[]="123456";
fun(a,strlen(a));puts(a);
}
程序运行后的输出结果是
A.654321
B.116611
C.161616
D.123456
第2题:
下面程序的输出结果是 #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
第3题:
2、以下程序输出的结果是() #include " stdio.h" #include "string.h" void fun (char *w, int m ) { char s, *p1 , *p2 ; p1=w; p2=w+m-1; while(p1<p2) { s=*p1++; *p1=*p2-- ; *p2=s; } } main() { char a[ ]="1234567"; fun (a , strlen(a) ); puts(a); }
A.7654321
B.1711717
C.1711771
D.7177171
第4题:
下面程序的输出结果是 #include<stdio.h> #include<string.h> main() { char *p1="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,strcat(p1,p2)); printf("%s\n",str);}
A.xyzabcABC
B.zabcABC
C.xyabcABC
D.yzabcABC
第5题:
试题35
有以下程序
#include <stdio.h>
#include <string.h>
void fun(char *w,int m)
{ char s, *p1, *p2;
p1=w; p2=w+m-1;
while(p1<p2){s=*p1; *p1=*p2; *p2=s; p1++; p2- -;}
}
main()
{ char a[]=”123456”;
fun(a, strlen(a)); puts(a);
}
程序运行后的输出结果是()
A.654321
B.116611
C.161616
D.123456