#include <stdio.h>
int swap(int *p1,int *p2){
int temp;
temp=*p1;
*p1=*p2;
*p2=temp;
return 0;
}
int main(){
int a;
int b;
int c;
int *pa;
int *pb;
int *pc;
scanf("%d %d %d",&a,&b,&c);
pa=&a;
pb=&b;
pc=&c;
if(*pa>*pb)
swap(pa,pb);
if(*pb>*pc)
swap(pb,pc);
if(*pa>*pb)
swap(pa,pb);
printf("%d %d %d",*pa,*pb,*pc);
return 0;
}
标签:p2,int,pb,pc,pa,swap,大小,从小到大,指针
From: https://www.cnblogs.com/JK8395/p/16873248.html