返回列表 發帖
  1. #include <cstdlib>
  2. using namespace std;
  3. int main()
  4. {
  5.     int a,b,c;
  6.     cout<<"請依序輸入三個數字:";  
  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.     cout<<"三數中最大的數是:";  
  17.     if(tmp>c)
  18.     {
  19.       cout<<tmp<<endl;      
  20.     }else
  21.     {
  22.       cout<<c<<endl;
  23.     }
  24. system ("pause");
  25. return 0;
  26. }
複製代碼

TOP

返回列表