Description
输入三个整数x,y,z,请把这三个数由小到大输出。
Input
输入数据包含3个整数x,y,z,分别用逗号隔开。
Output
输出由小到大排序后的结果,用空格隔开。
Sample
Input
2,1,3
Output
1 2 3
#include<stdio.h>
int main()
{
int a,b,c,temp;
scanf("%d,%d,%d",&a,&b,&c);
if(a<b)
{
temp = a;
a = b;
b = temp;
}
if(a<c)
{
temp = a;
a = c;
c = temp;
}
if(b<c)
{
temp = b;
b = c;
c = temp;
}
printf("%d %d %d",c,b,a);
return 0;
}