#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void Swap(int* pa, int* pb)
{
int temp = 0;
temp = *pb;
*pb = *pa;
*pa = temp;
}
int main()
{
int a = 20;
int b = 30;
printf("交换前a=%d b=%d\n", a, b);
Swap(&a,&b);
printf("交换后a=%d b=%d\n", a, b);
return 0;
}
C语言函数实现交换两个整型变量
最新推荐文章于 2023-06-25 16:53:49 发布