返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     re:
  7.     int score;
  8.     cout<<"請輸入你的成績: ";
  9.     cin>>score;
  10.     switch(score)
  11.     {
  12.          case 80 ... 100:
  13.              cout<<"A++"<<endl;
  14.          break;
  15.          
  16.          case 70 ... 79:
  17.              cout<<"B++"<<endl;
  18.          break;
  19.          case 60 ... 69:
  20.              cout<<"C++"<<endl;
  21.          break;
  22.          case 0 ... 59:
  23.              cout<<"F--"<<endl;
  24.          break;
  25.          default:
  26.              cout<<"別鬧了"<<endl;                  
  27.     }
  28.     goto re;
  29.     system("pause");
  30.     return 0;   
  31. }
複製代碼

TOP

返回列表