//更换a b的值,而p1和p2 的 值不变
void swap(int *p1, int *p2)
{
int tmp;
tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
int main() {
int a, b;
int *pointer_1, *pointer_2;
printf("please input two numbers\n");
scanf("%d %d", &a, &b);
pointer_1 = &a;
pointer_2 = &b;
if (a<b)
{
swap(pointer_1, pointer_2);
}
printf("a = %d , b = %d\n", a, b);
printf("Max = %d, Min = %d\n", *pointer_1, *pointer_2);
}