问答题

函数fun()的功能是:交换主函数中两个变量的值。例如,若变量a中的值原为8,b中的值为3,程序运行后a中的值为3,b中的值为8。
#include<stdio.h>
/**********found**********/
void fun(int x,int y)

int t;
/**********found**********/
t=x;x=y;y=t;

main()

int a,b;
a=8;b=3;
fun(&a,&b);
printf("%d,%d\n",a,b);

【参考答案】

(A)void fun(int*x,int*y) (B)t=*x;*x=*y;*y=t;