三个数从小到大排列

时间:2020-12-04 19:31:48

#include<stdio.h>

#include<stdlib.h>

int main()
{
int a, b, c;
scanf_s("%d %d %d", &a, &b, &c);
int n;
if (a > b)
{
n = a;
a = b;
b = n;

}
if (b > c)
{
n = c;
c = b;
b = n;
}
if (a > c)
{
n = a;
a = c;
c = n;
}
printf("%d %d %d", a, b, c);
system("pause");

}