代码
#include <stdio.h>
void swap(int *a, int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
int main()
{
int x, y;
int *p = &x, *q = &y;
scanf("%d%d", &x, &y);
swap(p, q);
printf("x = %d, y = %d\n", x, y);
return 0;
}