返回列表 發帖
  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.     if(a>b&&b>c)
  9.         cout<<a<<">"<<b<<">"<<c<<endl;
  10.     else if(a>c&&c>b)
  11.         cout<<a<<">"<<c<<">"<<b<<endl;
  12.     else if(b>a&&a>c)
  13.         cout<<b<<">"<<a<<">"<<c<<endl;
  14.     else if(b>c&&c>a)
  15.         cout<<b<<">"<<c<<">"<<a<<endl;
  16.     else if(c>a&&a>b)
  17.         cout<<c<<">"<<a<<">"<<b<<endl;
  18.     else if(c>b&&b>a)
  19.         cout<<c<<">"<<b<<">"<<a<<endl;
  20.     else
  21.         cout<<"其中有兩數, 或三個數相等!"<<endl;
  22.     cout<<endl;
  23.     system("pause");
  24.     return 0;
  25. }
複製代碼

TOP

返回列表