C语言实现:给定两个整形变量的值,将两个值的内容进行交换
程序如下:
#include<stdio.h>
int main() {
int a = 1;
int b = 2;
int tmp;
tmp = a;
a = b;
b = tmp;
printf("a=%d b=%d", a, b);
system("pause");
return 0;
}
C语言实现:给定两个整形变量的值,将两个值的内容进行交换
程序如下:
#include<stdio.h>
int main() {
int a = 1;
int b = 2;
int tmp;
tmp = a;
a = b;
b = tmp;
printf("a=%d b=%d", a, b);
system("pause");
return 0;
}