返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.    int x,y,z;
  6.    cout<<"請輸入三個整數"<<endl;
  7.    cin>>x>>y>>z;
  8.    if(x>y&&y>z)
  9.     cout<<x<<">"<<y<<">"<<z<<endl;
  10.    else if(x>z&&z>y)
  11.     cout<<x<<">"<<z<<">"<<y<<endl;
  12.    else if(y>x&&x>z)
  13.     cout<<y<<">"<<x<<">"<<z<<endl;
  14.    else if(y>z&&z>x)
  15.     cout<<y<<">"<<z<<">"<<x<<endl;
  16.    else if(z>x&&x>y)
  17.     cout<<z<<">"<<x<<">"<<y<<endl;
  18.    else if(z>y&&y>x)
  19.     cout<<z<<">"<<y<<">"<<x<<endl;
  20.    else if(z==y&&y==x)
  21.     cout<<x<<"="<<y<<"="<<z<<endl;
  22.    else if(x==y&&y>x)
  23.     cout<<x<<"="<<y<<">"<<z<<endl;
  24.    else if(x>y&&y==x)
  25.     cout<<x<<">"<<y<<"="<<z<<endl;
  26.    else if(y>x&&x==z)
  27.     cout<<y<<">"<<x<<"="<<z<<endl;
  28.    else if(z==x&&x>y)
  29.     cout<<z<<"="<<x<<">"<<y<<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<<"輸入錯誤";

  36. system("pause");
  37. return 0;
  38. }
複製代碼

TOP

返回列表