返回列表 發帖
本帖最後由 許宸瑀 於 2021-11-20 11:54 編輯
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.   int a, b,c;
  7.    cin>>a>>b>>c;
  8.    int tmp=0;
  9.    if(a>b)
  10.    {
  11.      tmp =a;
  12.    }else
  13.    {
  14.     tmp =b;   
  15.    }
  16.    if(tmp>c){
  17.        cout<<tmp<<endl;        
  18.    }else
  19.    {
  20.       cout<<c<<endl;   
  21.    }
  22.    
  23.       tmp = (a>b) ? a:b;
  24.       tmp = (tmp>c) ? tmp:c;
  25.       cout<<tmp<<endl;
  26.    
  27.     system ("pause");
  28.     return 0;
  29. }
複製代碼

TOP

返回列表