返回列表 發帖
  1. import java.io.Console;
  2. public class XX
  3. {
  4.   public static void main(String args[])
  5.   {
  6.     Console c=System.console();

  7.     while (0<1)
  8.     {
  9.       float x;
  10.       System.out.println("輸入成績(0~100): ");
  11.       x=Float.parseFloat(c.readLine());
  12.       if (90<=x&&x<=100)
  13.       {
  14.         System.out.println("優");
  15.       }
  16.       else if (80<=x&&x<=89)
  17.       {
  18.         System.out.println("甲");
  19.       }
  20.       else if (70<=x&&x<=79)
  21.       {
  22.         System.out.println("乙");
  23.       }
  24.       else if (60<=x&&x<=69)
  25.       {
  26.         System.out.println("丙");
  27.       }
  28.       else if (0<=x&&x<=59)
  29.       {
  30.         System.out.println("丁");
  31.       }
  32.       else
  33.       {
  34.         System.out.println("輸入錯誤,請重新輸入");
  35.         System.out.println("********************");
  36.       }








  37.     }



  38.   }




  39. }
複製代碼

TOP

返回列表