返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.     re:
  6.     int a,b,c;
  7.     cout<<"請依序輸入三個數:"<<endl;
  8.     cin>>a>>b>>c;
  9.     if(a>b && b>c)
  10.         cout<<a<<">"<<b<<">"<<c<<endl;
  11.     else if(a>c && c>b)
  12.         cout<<a<<">"<<c<<">"<<b<<endl;
  13.     else if(b>a && a>c)
  14.         cout<<b<<">"<<a<<">"<<c<<endl;
  15.     else if(b>c && c>a)
  16.         cout<<b<<">"<<c<<">"<<a<<endl;
  17.     else if(c>a && a>b)
  18.         cout<<c<<">"<<a<<">"<<b<<endl;
  19.     else if(c>b && b>a)
  20.         cout<<c<<">"<<b<<">"<<a<<endl;
  21.     else
  22.         cout<<"其中兩個數, 或三個數相等!"<<endl;
  23.     goto re;

  24.     system("pause");
  25.     return 0;
  26. }
複製代碼

TOP

返回列表