#include<stdio.h>
#include<stdlib.h>
void swop(int* a, int* b) {
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int main() {
int x = 10;
int y = 20;
swop(&x, &y);
printf("x=%d y=%d", x, y);
system("pause");
return 0;
}
使用函数实现两个数的交换
最新推荐文章于 2022-03-07 21:47:34 发布