返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. re:
  7.     int x,y,z;
  8.     cout<<"請輸入3個數字:";
  9.     cin>>x>>y>>z;
  10.     if(x>y&&y>z)
  11.         cout<<x<<">"<<y<<">"<<z<<endl;
  12.     else if(x>z&&z>y)
  13.         cout<<x<<">"<<z<<">"<<y<<endl;
  14.     else if(y>x&&x>z)
  15.         cout<<y<<">"<<x<<">"<<z<<endl;
  16.     else if(y>z&&z>x)
  17.         cout<<y<<">"<<z<<">"<<x<<endl;
  18.     else if(z>x&&x>y)
  19.         cout<<z<<">"<<x<<">"<<y<<endl;
  20.     else if(z>y&&y>x)
  21.         cout<<z<<">"<<y<<">"<<x<<endl;
  22.     else if(x>y&&y==z)
  23.         cout<<x<<">"<<z<<"="<<y<<endl;
  24.     else if(x>z&&z==y)
  25.         cout<<x<<">"<<z<<"="<<y<<endl;
  26.     else if(y>x&&x==z)
  27.         cout<<y<<">"<<x<<"="<<z<<endl;
  28.     else if(y>z&&z==x)
  29.         cout<<y<<">"<<z<<"="<<x<<endl;
  30.     else if(z>x&&x==y)
  31.         cout<<z<<">"<<x<<"="<<y<<endl;
  32.     else if(z>y&&y==x)
  33.         cout<<z<<">"<<y<<"="<<x<<endl;
  34.     else
  35.         cout<<x<<"="<<y<<"="<<z<<endl;
  36.     cout<<endl;
  37.     goto re;
  38.     system("pause");
  39.     return 0;
  40. }
複製代碼

TOP

返回列表