编写交换两个变量值的函数,并调用该函数交换主函数中两个变量的值
C表示
人气:178 ℃ 时间:2020-04-10 08:09:54
解答
#include
void fun(int *a,int *b)
{
int temp ;
temp = *a ;
*a = *b ;
*b = temp ;
}
main()
{
int a=1;
int b=2;
fun(&a,&b);
printf("a=%d,b=%d",a,b);
}
推荐
猜你喜欢
- 关系代词 造句
- lost,case,in,that,is,watch,her,found,the,and(?)连词成句
- 请问现在2012年,一元硬币多重?是多少克?
- Many boys and girls learn English at school or at university.Because it is one of their---[subject]
- 某班有25名男生,23名女生,男生占女生的(),女生人数是全班人数的().(用分数表示)
- 英语中,当“一个物”做主语时,后面的动词用加S吗?
- 201012月六级算分
- 探究规律计算2-1 2^2-2-2^0 ……根据上面猜想的结论2^12-2^11-2^10-……2^6的值