有以下程序 void f(int*x,int*y) { int t; t=*x;*x=*y;*y=t; } main() { int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=&a[7]; while(p { f(p,q)

admin2013-02-23  48

问题 有以下程序 void f(int*x,int*y) { int t; t=*x;*x=*y;*y=t; } main() { int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=&a[7]; while(p { f(p,q);p++; q--; } for (i=0;i<8;i++)printf("%d,",a); } 程序运行后的输出结果是______。

选项 A、8,2,3,4,5,6,7,1,
B、5,6,7,8,1,2,3,4,
C、1,2,3,4,5,6,7,8,
D、8,7,6,5,4,3,2,1,

答案D

解析
转载请注明原文地址:https://jikaoti.com/ti/MFB0FFFM
0

最新回复(0)