返回列表 發帖
本帖最後由 t3742238 於 2011-10-1 17:00 編輯
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int score, level;
  6.     cout<<"請輸入你的成績: ";
  7.     cin>>score;
  8.     level = score/10;
  9.     switch(level)
  10.     {
  11.          case 10:
  12.          case 9:
  13.          case 8:
  14.               cout<<"好厲害歐!";
  15.               break;
  16.          case 7:
  17.               cout<<"再爛一點阿!";
  18.               break;
  19.          case 6:
  20.               cout<<"差一點點不及格可是還是很爛!";
  21.               break;
  22.          case 5:
  23.          case 4:
  24.          case 3:
  25.          case 2:
  26.          case 1:
  27.          case 0:
  28.               cout<<"爛ㄟ  你";
  29.               break;
  30.          default:
  31.               cout<<"輸入錯誤!  呆~~~子~";
  32.     }
  33.     cout<<endl;
  34.     system("pause");
  35.     return 0;
  36. }
複製代碼

TOP

返回列表