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

TOP

返回列表