返回列表 發帖
本帖最後由 楊芊琦 於 2022-10-29 15:13 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     re:
  7.     int a,b,c;
  8.     cin>>a>>b>>c;
  9.     if(a>b and b>c)
  10.     {
  11.          cout<<a<<">"<<b<<">"<<c<<endl;
  12.     }
  13.     else if(a>c and c>b)
  14.     {
  15.          cout<<a<<">"<<c<<">"<<b<<endl;
  16.     }
  17.     else if(b>a and a>c)
  18.     {
  19.          cout<<b<<">"<<a<<">"<<c<<endl;
  20.     }
  21.     else if(b>c and c>a)
  22.     {
  23.          cout<<b<<">"<<c<<">"<<a<<endl;
  24.     }
  25. else if(c>a and a>b)
  26.     {
  27.          cout<<b<<">"<<a<<">"<<c<<endl;
  28.     }
  29.      else if(c>b and b>a)
  30.     {
  31.          cout<<c<<">"<<b<<">"<<a<<endl;
  32.     }else if(c>a and a>c)
  33.     {
  34.          cout<<c<<">"<<a<<">"<<b<<endl;
  35.     }
  36.     else
  37.     {
  38.         cout<<"內有相等數,電腦懶得數"<<endl;
  39.     }
  40.     goto re;
  41.     system("pause");
  42.     return 0;
  43. }
複製代碼

TOP

返回列表