返回列表 發帖
回復 1# tonyh
  1.                 import java.io.Console;
  2. public class ch09
  3. {
  4.   public static void main(String args[])
  5.   {
  6.     Console keyin=System.console();
  7.     int int1;
  8.     Float ft2;
  9.     System.out.print("請你的成績:");
  10.     int1=Integer.parseInt(keyin.readLine());
  11.     int1=int1/10;
  12.     switch(int1)
  13.     {
  14.     case 10:
  15.     System.out.print("恭喜您當老師了!");
  16.     break;
  17.     case 9:  case 8:  case 7:  case 6:
  18.     System.out.print("恭喜您及格了!");
  19.     break;
  20.     case 5:   case 4:  case 3:  case 2:  case 1:
  21.     System.out.print("恭喜您重修了!");
  22.     break;
  23.     case 0:
  24.     System.out.print("恭喜您可以回家了!");
  25.     break;
  26.     default:
  27.     System.out.print("恭喜您亂打了!");
  28.     }
  29.   }
  30. }
複製代碼

TOP

返回列表