void change_math(int *px, int *py)
{
int temp = 0;
temp = *px;
*px = *py;
*py = temp;
}
int main()
{
int x = 0; int y = 0;
printf("请输入两个数:");
scanf("%d %d", &x, &y);
int *px = &x; int *py = &y;
change_math(px, py);
printf("%d %d", x, y);
system("pause");
return 0;
}
运行结果: