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

TOP

返回列表