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

TOP

返回列表