#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<windows.h>
int Exchange(int *pa, int *pb)
{
int c = 0;
c = *pa;
*pa = *pb;
*pb = c;
return *pa, *pb;
}
int main()
{
int a = 0;
int b = 0;
printf("请输入数字a:");
scanf("%d", &a);
printf("请输入数字b:");
scanf("%d", &b);
Exchange(&a, &b);
printf("a=%d b=%d\n",a,b);
system("pause");
return 0;
}
#include<stdio.h>
#include<windows.h>
int Exchange(int *pa, int *pb)
{
int c = 0;
c = *pa;
*pa = *pb;
*pb = c;
return *pa, *pb;
}
int main()
{
int a = 0;
int b = 0;
printf("请输入数字a:");
scanf("%d", &a);
printf("请输入数字b:");
scanf("%d", &b);
Exchange(&a, &b);
printf("a=%d b=%d\n",a,b);
system("pause");
return 0;
}