返回列表 發帖

if...else 判斷式

本帖最後由 tonyh 於 2015-7-24 15:58 編輯

  1. // if...else 判斷式
  2. #include<iostream>
  3. #include<cstdlib>
  4. using namespace std;
  5. int main()
  6. {
  7.     int score;
  8.     cout<<"請輸入你的成績: ";
  9.     cin>>score;
  10.     if(score>=60)
  11.     {
  12.         cout<<"恭喜你!及格了!"<<endl;
  13.     }else
  14.     {
  15.         cout<<"不及格.. 斬!"<<endl;
  16.     }
  17.     system("pause");
  18.     return 0;   
  19. }
複製代碼

返回列表