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.7654321B.1711717C.1711771D.7177171

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


参考答案和解析
28 a*=16+(b++)-(++c)等价于a=a*(16+(b++)-(++c)),b++的值为3,++c的值为5,这里要注意前缀++和后缀++的用法。

相关考题:

下面程序的输出结果是()。includeincludemain(){char p1[]="WHO",p2[]="who 下面程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() {char p1[]="WHO",p2[]="who",str[50]="xyz"; strcpy(str+1,strcat(p1,p2)); printf("%s",str);}A.xyzWHOwhoB.zWHOwhoC.zWHOwhoD.xWHOwho

有以下程序并includeincludefun(char * w,int n){char t,*s1,*s2; s1=w;s2= 有以下程序 并include<stdio.h> #include<string.h> fun(char * w,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while(s1<s2) { t=*s1++; * s1=*s2--; * s2=t; } } main() { char p[]="1234567"; fun(p,strlen(p)); puts(p); } 程序运行后的输出结果是( )A.1234567B.7654321C.1711717D.7177171

下列程序的运行结果是【 】。 include include void main() {char * a[5 下列程序的运行结果是【 】。include<iostream. h>include<string. h>void main(){char * a[5]={"stuent","worker","teacher","soldier"," peasant"};char * p1, * p2;p1=p2=a[0]for(int i=0;i<5;i++){if(strcmp(a[i],p1)>0)p1=a[i];if(strcmp(a[i],p2)<0)p2=a[i];}cout<<p1<<","<<p2<<endl;}

以下程序includeincludemain(){char*p1="abc",*p2="ABC",str[50]="xyz", s 以下程序 #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.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC

以下程序的输出结果是______。includeincludefun(char*w,int n){ char t,*s 以下程序的输出结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171

以下程序的输出结果是______。includeincludefun(char *w,int n){ char t,* 以下程序的输出结果是______。 #include<stdio.h> #include<siring.h> fun(char *w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char *p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171

下面程序的输出结果是 include includevoid main( ) { char p1[10] ,p2 下面程序的输出结果是#include<iostream.h>#include<string.h>void main( ){char p1[10] ,p2[10] ;strcpy(p1,"abc") ;strcpy(p2,"ABC") ;char str[50] ="xyz";strcpy(str+2,strcat(p1,p2) ) ;cout < < str;}A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

以下程序includeincludemain(){ char*p1="abc",*p2=-"ABC", str, [50]="xy 以下程序#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.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC

下面程序的输出结果是______。includemain(){char*p1="abc",*p2="ABC",s[20]="xyz"; s 下面程序的输出结果是______。 #include<string.h> main() { char*p1="abc",*p2="ABC",s[20]="xyz"; strcpy(s+1,p2); strcat(s+2,p1); printf("%s\n",s); }A.xABCabcB.zABCabcC.yzabcABCD.xyzABCabc

以下程序includeincludemain(){ char*p1="abc",*p2="ABC",str[50]="xyz";s 以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,strcat(p1,p2)); printf("%ss\n",str); } 的输出是______。A.xyzabcABCB.zabcABCC.yzbcABCD.xyabcABC

下面程序的输出结果是includeincludevoid main( ){char p1[10],p2[10]s 下面程序的输出结果是 #include<iostream.h> #include<string.h> void main( ) { char p1[10],p2[10] strcpy(p1,"abc"); strcpy(p2,"ABC"); char str[50]="xyz"; strcpy(str+2,strcat(p1,p2));A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

下列程序运行后,输出结果是______。 include include fun(char *w ,int 下列程序运行后,输出结果是______。 #include <stdio. h> #include <string. h> fun (char *w ,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while (s1<s2) { t=*s1++; *s1=*s2--; *s2=t; } } main () { char *p; p="1234567"; fun (p, strlen (p)); puts (p); }A.1234567B.7654321C.1711717D.7177171

下面程序的输出结果是includeincludevoid main(){char p1[10],P2[10]; 下面程序的输出结果是 #include<iostream.h> #include<string.h> void main() { char p1[10],P2[10]; strcpy(p1,"abc"); strcpy(p2,"ABC"); char str[50]="xyz"; strcpy(str+2,strcat(P1,p2)); cout<<six; }A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

有以下程序:void fun(char* a,char* B) ;{a=b;(*A) ++;}main(){charc1='A',c2='a',*p1,*p2;p1= } main() { char c1='A',c2='a',*p1,*p2; p1=cl; p2=c2: fun(p1,p2); printf("%c%c\n",c1,c2); } 程序运行后的输出结果是A.AbB.aaC.AaD.Bb

有以下程序:void fun (char *a,char *b){a=b;(*a)++;}main(){char cl='A',c2='a',*p1,*p2;p1=(*a)++;} main() { char cl='A',c2='a',*p1,*p2; p1=c1;p2=c2;fun (p1,p2); printf("%c,%c\n",c1,c2); } 程序运行后的输出结果是( )。A.AbB.aaC.AaD.Bb

以下程序的输出结果是_______。includeincludefun(char*w,int n){char t,*s 以下程序的输出结果是_______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++: *sl=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171

下面程序的输出结果为______。 include main() { char p1[7]="abc",p2[]="ABC",str[50 下面程序的输出结果为______。 #include<string.h> main() { char p1[7]="abc",p2[]="ABC",str[50]="xyz"; strcpy(str,strcat(p1,p2)); printf("%s",str); }A.xyzabcABCB.abcABCC.xyzabcD.xyzABC

下面程序的输出是______。 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.ABCDEFGB.DEFGABCC.GFEDCBAD.CBADGFE

下面程序的输出结果是()。includeincludevoid main(){char p1[10],p2[10 下面程序的输出结果是( )。 #include<iostream.h> #include<string.h> void main() { char p1[10],p2[10]; strcpy(p1,”abc”); strcpy(p2,”ABC”); charsty[50]=“xyz”; strcpy(str+2,strcat(p1,p2)); cout<<str; }A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

下面程序的输出结果是 ( ) include include { char * p1="abc" , * 下面程序的输出结果是 ( ) # include<stdio.h> # include<string.h> { char * p1="abc" , * p2=" ABC ",str[50]="xyz"; strcpy(str+2.strcat (pi,p2)); printf("%s\n",str);}A.xyzabcABB.zabcABCC.yzabcABCD.xycbcABC

有以下程序: #includestdio.h #include!(string.h void fun(char*w,int m) { char S,*pl,*p2; p1=w;p2=w+m-; while(plp2){s=*pl; *p1=*p2; *p2=s;pl++;p2-;} } main( ) { char a[]="l23456"; fun(a,strlen(a));puts(a); } 程序运行后的输出结果是( )。A.654321B.116611C.161616D.l23456

有以下程序#includestdio.h#includestring.hvoid fun(char *w,int m){ char s,*p1,*p2;p1=w;p2=w+m-1;while(p1p2){s=*p1;*p1=*p2;*p2=s;p1++;p2--;}}main(){ char a[]="123456";fun(a,strlen(a));puts(a);}程序运行后的输出结果是A.654321B.116611C.161616D.123456

下面程序的输出结果是includeincludevoid main( ){char p1[10],p2[10]s 下面程序的输出结果是 #include<iostream.h> #include<string.h> void main( ) { char p1[10],p2[10] strcpy(p1,"abc"); strcpy(p2,"ABC"); char str[50]="xyz"; strcpy(str+2,strcat(p1,p2)); cout<<str; }A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

下面程序的输出结果是includeincludemain(){char *p1="abc",*p2="ABC",str 下面程序的输出结果是 #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.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

以下程序 include include main() { char*p1="abc",*p2="ABC",str[50]="xy 以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(ar+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是______。A.xyzabcABCB.zabeABCC.yzabcABCD.xyabcABC

有以下程序:includevoid fun(char *a, char *b){ a=b;(*a)++;}main(){char c1='A',c2= 有以下程序: #include <stdio.h> void fun(char *a, char *b) { a=b; (*a)++;} main() { char c1='A',c2='a',*p1,*p2; p1=c1; P2=c2; fun(p1,p2); printf("%c%c\n",c1,c2); } 程序运行后的输出结果是( )。A.AbB.aaC.AaD.Bb

下面程序的运行结果是______。 include include fun(char*w,int n) { char 下面程序的运行结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) {t=*s1++;*s1=*s2--;*s2=t;} } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.7654321B.1714171C.1711717D.7177171

试题35有以下程序#include stdio.h#include string.hvoid fun(char *w,int m){ char s, *p1, *p2;p1=w; p2=w+m-1;while(p1p2){s=*p1; *p1=*p2; *p2=s; p1++; p2- -;}}main(){ char a[]=”123456”;fun(a, strlen(a)); puts(a);}程序运行后的输出结果是()A.654321B.116611C.161616D.123456