#include <stdio.h> void fun(int* a, int* b) { int temp; temp = *a; *a = *b; *b = temp; } int main(void) { int x, y; printf("请输入两个数: "); scanf("%d %d", &x, &y); fun(&x, &y); printf("两个数交换位置后为:%d %d", x, y); return 0; }