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




  33. }
複製代碼

TOP

返回列表