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

TOP

返回列表