17、给定程序MODI1.C中函数fun的功能是:通过某种方式实现两个变量值的交换,规定不允许增加语句和表达式。例如变量a 中的值原为8,b中的值原为3, 程序运行后 a 中的值为 3,b中的值为8。
请改正程序中的错误,使它能得出正确的结果。
注意: 不要改动 main 函数,不得增行或删行,也不得更改程序的结构!
#include int fun(int *x,int y)
{
int t ;
/**************found**************/
t = x ; x = y ;
/**************found**************/
return(y) ;
}
main()
{
int a = 3, b = 8 ;
printf("%d %d\n", a, b) ;
b = fun(&a, b) ;
printf("%d %d\n", a, b) ;
}
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15080520号-20 珠峰网 版权所有 All Rights Reserved
|