返回列表 發帖
  1. #include<iostream>   
  2. #include<cstdlib>   
  3. using namespace std;
  4. int main()
  5. {
  6.     int a, b, c;
  7.     re:
  8.     cout<<"請任意輸入三個數: ";
  9.     cin>>a>>b>>c;
  10.    //1
  11.     if(a>b and b>c)
  12.       cout<<a<<">"<<c<<">"<<b<<endl;
  13.    //2
  14.        else if(a>c and c>b)
  15.        cout<<a<<">"<<c<<">"<<b<<endl;
  16.    //3
  17.          else if(a==b and b>c)
  18.          cout<<a<<"="<<b<<">"<<c<<endl;
  19.    //4
  20.            else if(a>c and c==b)
  21.            cout<<a<<">"<<c<<"="<<b<<c<<endl;
  22.    
  23.    else if(b>a and a>c)
  24.    cout<<b<<">"<<a<<">"<<c<<endl;
  25.    //5
  26.       else if(b>c and c>a)
  27.       cout<<b<<">"<<c<<">"<<a<<endl;
  28.    
  29.          else if(b==c and c>a)
  30.          cout<<b<<"="<<c<<">"<<a<<endl;
  31.    //5
  32.              else if(b>c and c==a)
  33.              cout<<b<<">"<<c<<"="<<a<<endl;
  34.    
  35.    //6
  36.     else if(c>a and a>b)
  37.     cout<<c<<">"<<a<<">"<<b<<endl;
  38.    //7
  39.         else if(c>b and b>a)
  40.         cout<<c<<">"<<b<<">"<<a<<endl;
  41.    
  42.    else if(c=b and b>a)
  43.     cout<<c<<">"<<b<<">"<<a<<endl;
  44.    //7
  45.         else if(c>b and b==a)
  46.         cout<<c<<">"<<b<<"="<<a<<endl;
  47.    
  48.    //8
  49.     else
  50.         
  51.     cout<<a<<"="<<b<<"="<<c<<endl;
  52.     goto re;
  53.    
  54.    
  55.    
  56.    
  57.    
  58.    

  59. system("pause");   
  60.     return 0;
  61. }
複製代碼

TOP

返回列表