input two numbers:a,b34,66
max=66,min=34Press any key to continue
#include
#include
void main()
{
void swap(int *p1,int *p2);
int * pointer_1,* pointer_2;
int a,b;
printf("input two numbers:a,b");
scanf("%d,%d",&a,&b);
pointer_1=&a;pointer_2=&b;
if(a swap(pointer_1,pointer_2);
printf("max=%d,min=%d",a,b);
}
void swap(int *p1, int *p2)
{int temp;
temp=*p1; //手误 p大小写
*p1=*p2;
*p2=temp;
}
temp=*P1;
改为小写小行了:
temp=*p1;
temp=*P1 的P1改正小写的p1