返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int score, level;
  6.     cout<<"please key in your score:";
  7.     cin>>score;
  8.     level = score/10;
  9.     switch(level)
  10. {
  11.          case 10:
  12.          case 9:
  13.          case 8:
  14.                 cout<<"super";
  15.          break;
  16.          case 7:
  17.                 cout<<"Oh!dear!!";
  18.          break;
  19.          case 6:
  20.                 cout<<"that's terrible";
  21.          break;
  22.          case 5:
  23.          case 4:
  24.          case 3:
  25.          case 2:
  26.          case 1:
  27.          case 0:
  28.                 cout<<"not great";
  29.          break;
  30.          default:
  31.                 cout<<"you key in the wrong thing!";
  32. }
  33.     cout<<endl;
  34.     system("pause");
  35.     return 0;
  36. }
複製代碼

TOP

返回列表