1274:三整数排序
Description
输入三个整数从小到大排序后输出
Input
输入a,b,c。
Output
排序后的a,b,c两个数之间用空格隔开,行末没有空格。
Sample Input
20 7 33
Sample Output
7 20 33
Source
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
int temp;
cin>>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=c;c=b;b=temp;
}
cout<<a<<b<<c;
return 0;
}