返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>

  3. using namespace std;
  4. int main()
  5. {
  6.         int x;
  7.         cout << "請輸入您的成績";
  8.         cin >> x;
  9.         x= x/10;
  10.         switch (x)
  11.         {
  12.                 case 10:
  13.                 cout << "優";
  14.                 break;
  15.                 case 9:
  16.                 cout << "優";
  17.                 break;
  18.                 case 8:
  19.                 cout << "甲";
  20.                 break;
  21.                 case 7:
  22.                 cout << "乙";
  23.                 break;
  24.                 case 6:
  25.                 cout << "丙";
  26.                 break;
  27.                 case 5:
  28.                 cout << "丁";
  29.                 break;
  30.                 case 4:
  31.                 cout << "丁";
  32.                 break;
  33.                 case 3:
  34.                 cout << "丁";
  35.                 break;
  36.                 case 2:
  37.                 cout << "丁";
  38.                 break;
  39.                 case 1:
  40.                 cout << "丁";
  41.                 break;
  42.                 case 0:
  43.                 cout << "丁";
  44.                 break;
  45.                 default:
  46.                 cout << "很皮喔!";
  47.                 break;
  48.         }
  49.         return 0;
  50. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>

  3. using namespace std;
  4. int main()
  5. {
  6.         int x;
  7.         cout << "請輸入您的成績";
  8.         cin >> x;
  9.         x= x/10;
  10.         switch (x)
  11.         {
  12.         case 10:
  13.                 cout << "優";
  14.                 break;
  15.         case 9:
  16.                 cout << "優";
  17.                 break;
  18.         case 8:
  19.                 cout << "甲";
  20.                 break;
  21.         case 7:
  22.                 cout << "乙";
  23.                 break;
  24.         case 6:
  25.                 cout << "丙";
  26.                 break;
  27.         case 5:
  28.                 cout << "丁";
  29.                 break;
  30.         case 4:
  31.                 cout << "丁";
  32.                 break;
  33.         case 3:
  34.                 cout << "丁";
  35.                 break;
  36.         case 2:
  37.                 cout << "丁";
  38.                 break;
  39.         case 1:
  40.                 cout << "丁";
  41.                 break;
  42.         case 0:
  43.                 cout << "丁";
  44.                 break;
  45.         default:
  46.                 cout << "很皮喔!";
  47.                 break;
  48.         }
  49.         return 0;
  50. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>

  3. using namespace std;
  4. int main()
  5. {
  6.         int x;
  7.         cout << "請輸入您的成績";
  8.         cin >> x;
  9.         x= x/10;
  10.         switch (x)
  11.         {
  12.         case 10:case 9:
  13.                 cout << "優";
  14.                 break;
  15.         case 8:
  16.                 cout << "甲";
  17.                 break;
  18.         case 7:
  19.                 cout << "乙";
  20.                 break;
  21.         case 6:
  22.                 cout << "丙";
  23.                 break;
  24.         case 5:case 4:case 3:case 2:case 1:case 0:
  25.                 cout << "丁";
  26.                 break;
  27.         default:
  28.                 cout << "很皮喔!";
  29.                 break;
  30.         }
  31.         return 0;
  32. }
複製代碼

TOP

返回列表