返回列表 發帖
本帖最後由 t3742238 於 2011-11-12 16:16 編輯
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int a, b, max;
  6.     cout<<"請輸入第1個數: ";
  7.     cin>>a;
  8.     cout<<"請輸入第2個數: ";
  9.     cin>>b;
  10.     max=(a>b)?a:b;
  11.     cout<<"兩數中較大的數為"<<max;
  12.     cout<<endl;
  13.     system("pause");
  14.     return 0;
  15. }
複製代碼

TOP

返回列表