有以下程序 #include<stdio.h> #include<string_h> voidfun(char*W,intm) {chars,*p1,*p2; p1=w;p2=w+m-1; while(pl<p2){s=*p1;*p1=*p2;*p2=s;

admin2020-11-23  22

问题 有以下程序
#include<stdio.h>
#include<string_h>
voidfun(char*W,intm)
{chars,*p1,*p2;
p1=w;p2=w+m-1;
while(pl<p2){s=*p1;*p1=*p2;*p2=s;p1++;p2-;}
}
main(    )
{1chara[]=“123456“;
fun(a,strlen(a));puts(a);
}

选项 A、116611
B、161616
C、65432l
D、123456

答案C

解析 函数fun的功能是将字符串w中的元素从大到小进行排列,所以在主函数中调用函数fun后,字符串a的元素从大到小进行了排列。
转载请注明原文地址:https://kaotiyun.com/show/Pc3p777K
0

相关试题推荐
最新回复(0)