返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;

  4. int main(){
  5.     int a,b,c;
  6.     cout<<"請任意輸入三個數";
  7.     cin>>a>>b>>c;
  8.    
  9.     if(a>b and b>c)
  10.            cout<<a<<">"<<b<<">"<<c<<endl;
  11.     else if (a>c and c>b)
  12.            cout<<a<<">"<<c<<">"<<b<<endl;
  13.     else if (b>a and a>c)
  14.            cout<<b<<">"<<a<<">"<<c<<endl;
  15.     else if (b>c and c>a)
  16.            cout<<b<<">"<<c<<">"<<a<<endl;
  17.     else if (c>a and a>b)
  18.            cout<<c<<">"<<a<<">"<<b<<endl;
  19.     else if (c>b and b>a)
  20.            cout<<c<<">"<<b<<">"<<a<<endl;
  21.     else
  22.            cout<<"其中兩個數, 或三個數相等!"<<endl;
  23.            
  24.    
  25.     system("pause");
  26.     return 0;
  27.     }
複製代碼

TOP

返回列表