返回列表 發帖
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int score;
  6.     int level;
  7.     cout<<"請輸入您的分數: ";
  8.     cin>>score;
  9.     level=score/10;
  10.     switch(level)
  11.     {
  12.         case 10:
  13.         case 9:
  14.              cout<<"得 A !"<<endl;
  15.              break;
  16.         case 8:
  17.              cout<<"得 B !"<<endl;
  18.              break;
  19.         case 7:
  20.              cout<<"得 C !"<<endl;
  21.              break;
  22.         case 6:
  23.              cout<<"得 D !"<<endl;
  24.              break;
  25.         default:
  26.              cout<<"得 E !不 及 格!"<<endl;
  27.              break;
  28.     }
  29.     system("pause");
  30.     return 0;
  31. }
複製代碼

TOP

返回列表