返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x,y,z;
  7.     {
  8.        cout<<"請輸入三個值:";
  9.        cin>>x>>y>>z;
  10.        if(x>y&&y>z)
  11.        {
  12.          cout<<x<<">"<<y<<">"<<z;  
  13.        }  
  14.        else if(x>z&&z>y)
  15.        {
  16.          cout<<x<<">"<<z<<">"<<y;   
  17.        }
  18.        else if(y>z&&z>x)
  19.        {
  20.          cout<<y<<">"<<z<<">"<<x;   
  21.        }
  22.        else if(y>x&&x>z)
  23.        {
  24.          cout<<y<<">"<<x<<">"<<z;   
  25.        }
  26.        else if(z>x&&x>y)
  27.        {
  28.          cout<<z<<">"<<x<<">"<<y;   
  29.        }
  30.        else if(z>y&&y>x)
  31.        {
  32.          cout<<z<<">"<<y<<">"<<x;   
  33.        }   
  34.        else
  35.        {
  36.          cout<<"其中兩個數, 或三個數相等!"<<endl;   
  37.        }
  38.    
  39.     }
  40.     system("pause");
  41.     return 0;
  42.         
  43. }
複製代碼

TOP

返回列表