选择题
有以下程序:
#include<stdio.h>
#include<string.h>
void fun(char*w, int m)
{ char s, *p1, *p2;
p1=w; p2=w+m-;
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
【正确答案】
A
【答案解析】
此题是需要将a[]中的数值倒过来进行输出,所以答案为A。
提交答案
关闭