[单选题]

试题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

参考答案与解析: