返回列表 發帖
  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
  23.         cout<<"有數字相等!"<<endl;
  24.     cout<<endl;
  25.     goto re;
  26.     system("pause");
  27.     return 0;
  28. }
複製代碼

TOP

返回列表