#include<stdio.h>
#include<stdlib.h>
void swap(int* p,int* q)
{
int temp = 0;
temp = *p;
*p = *q;
*q = temp;
}
int main()
{
int a = 10;
int b = 20;
swap(&a,&b);
printf("a=%d b=%d",a,b);
system("pause");
return 0;
}
函数实现两个数的交换
最新推荐文章于 2022-11-14 00:53:34 发布