#include<stdio.h>
void exchange(int *q1,int *q2,int *q3);
void swap(int *t1,int *t2)
{
if(*t1<*t2)
{
int temp;
temp=*t1;
*t1=*t2;
*t2=temp;
}
}
int main()
{
int a,b,c,*p1,*p2,*p3;
scanf("%d%d%d\n",&a,&b,&c);
p1=&a;
p2=&b;
p3=&c;
exchange(p1,p2,p3);
printf("%d %d %d",a,b,c);
return 0;
}
void exchange(int *q1,int *q2,int *q3)
{
swap(q1,q2);
swap(q1,q3);
swap(q2,q3);
}
图片: