当前位置: 代码迷 >> 综合 >> 使用函数实现两个数的交换
  详细解决方案

使用函数实现两个数的交换

热度:101   发布时间:2023-09-05 19:32:06.0

#include<stdio.h>
#include<Windows.h>
int swaq(int *a,int *b)
{
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int main()
{
int a = 90;
int b = 85;
swaq(&a, &b);
printf(“a=%d b=%d\n”, a, b);
system(“pause”);
return 0;
}
结果
使用函数实现两个数的交换

  相关解决方案