返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     cout<<"請輸入成績:"<<endl;
  8.     cin>> x;
  9.     switch(x)
  10.     {
  11.              case 80...100:
  12.              cout<<"甲等"<<endl;
  13.              break;
  14.              case 70...79:
  15.              cout<<"乙等"<<endl;
  16.              break;
  17.              case 60...69:
  18.              cout<<"丙等"<<endl;
  19.              break;
  20.              case 0...59:
  21.              cout<<"甲等"<<endl;
  22.              break;
  23.              default:
  24.              cout<<"不誠實"<<endl;         
  25.     }         
  26.     system("pause");
  27.     return 0;
  28. }
複製代碼

TOP

返回列表