#include<stdio.h>
int main()
{
int a, b, c, t;
scanf_s("%d %d %d", &a, &b, &c);
if (a < b)
{
t = a; //借助变量t,实现变量a和变量b互换值
a = b;
b = t;
} //互换后,b小于或等于a
if (a < c)
{
t = a; //借助变量t,实现变量a和变量c互换值
a = c;
c = t;
} //互换后,c小于或等于a
if (b < c)
{
t = b; //借助变量t,实现变量b和变量c互换值
b = c;
c = t;
} //互换后,c小于或等于a
printf("从大到小排列:");
printf("%d %d %d", a, b, c);
return 0;
}
输出举例: