#include <stdio.h>void Swap(int *a,int *b) // Swap大写S开头,避免与c++ STL中的swap()函数重名
{
*a^=*b^=*a^=*b;
/* 也可使用这段代码,利用中间变量t进行交换
int t=*a;
*a=*b;
*b=t;
*/
}int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a<b) Swap(&a,&b);
if(b<c) Swap(&b,&c);
if(a<b) Swap(&a,&b);
printf("%d %d %d\n",a,b,c);
return 0;
}
温馨提示:答案为网友推荐,仅供参考