游客 Signup | Login
中文 | En

2443 - 【入门】求三个数的大小顺序

输入三个数,按由大到小顺序打印出来。

Input

输入只有一行,包括3个整数。之间用一个空格分开。

Output

输出只有一行,包括3个整数。之间用一个空格分开。

Examples

Input

3 8 2

Output

8 3 2

Solution C++

#include <iostream>
using namespace std;
int main()
{
  int a[3];
  for(int i=0;i<3;i++)
    cin>>a[i];
  for(int j=0;j<3;j++)
  {
    if(a[j]<a[j+1])
    {
      int z=a[j];
          a[j]=a[j+1];
          a[j+1]=z;
      
    }
	
  }
  for(int x=0;x<3;x++)
	  cout<<a[x]<<" ";
  return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题