返回列表 發帖
  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.                 cout<<"A級 !"<<endl;
  14.                 break;
  15.            case 8:
  16.                 cout<<"B級 !"<<endl;
  17.                 break;
  18.            case 7:
  19.                 cout<<"C級 !"<<endl;
  20.                 break;
  21.            case 6:
  22.                 cout<<"D級 !"<<endl;
  23.                 break;
  24.            default:     
  25.                 cout<<"不及格!"<<endl;
  26.      }
  27.    
  28.      system("pause");
  29.      return 0;   
  30. }
複製代碼

TOP

返回列表