返回列表 發帖
本帖最後由 林宇翔 於 2014-3-8 15:04 編輯
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.         int x;
  7.         cout << "請輸入你的分數:";
  8.         cin >> x;
  9.         x = x / 10 ;
  10.         switch(x)
  11.         {
  12.         case 10:
  13.         case 9:
  14.                 cout << "優";
  15.                 break;
  16.         case 8:
  17.                 cout << "甲";
  18.                 break;
  19.         case 7:
  20.                 cout << "乙";
  21.                 break;
  22.         case 6:
  23.                 cout << "丙";
  24.                 break;
  25.         case 5: case 4:case 3:case 2:case 1:case 0:
  26.                 cout << "丁";
  27.                 break;
  28.         default:
  29.                 cout << "找死喔";         
  30.         }
  31.         system ("pause");
  32.         return 0;
  33. }
複製代碼

TOP

返回列表