返回列表 發帖
  1. #include <iostream>

  2. using namespace std;

  3. int main()
  4. {
  5.    int a,b,c;
  6.    cout<<"請輸入第1個數"<<endl;
  7.    cin>>a;
  8.    cout<<"請輸入第2個數"<<endl;
  9.    cin>>b;   
  10.    cout<<"請輸入第3個數"<<endl;
  11.    cin>>c;
  12.    if(a>b && a>c)
  13.    {
  14.       if(b>c)
  15.       {
  16.       cout<<a<<">"<<b<<">"<<c;
  17.       }else
  18.       {
  19.       cout<<a<<">"<<c<<">"<<b;
  20.       }      
  21.   }
  22.   if(b>a && b>c)
  23.    {
  24.       if(a>c)
  25.       {
  26.       cout<<b<<">"<<a<<">"<<c;
  27.       }else
  28.       {
  29.       cout<<b<<">"<<c<<">"<<a;
  30.       }      
  31.   }
  32.   if(c>a && c>b)
  33.    {
  34.       if(b>a)
  35.       {
  36.       cout<<c<<">"<<b<<">"<<a;
  37.       }else
  38.       {
  39.       cout<<c<<">"<<a<<">"<<b;
  40.       }      
  41.   }
  42.   

  43.    

  44.   system("pause");

  45.   return 0;   

  46. }
複製代碼

TOP

返回列表