返回列表 發帖
  1. import java.io.Console;
  2. public class a
  3. {
  4.      public static void main(String args[])
  5.      {
  6.            int x;
  7.            Console c=System.console();
  8.            x=Integer.parseInt(c.readLine("請輸入分數: "));
  9.            if (x<0||x>100)
  10.            System.out.println("錯誤!");
  11.            else if(x>=90)
  12.            System.out.println("優!");
  13.            else if(x>=80)
  14.            System.out.println("甲!");
  15.            else if(x>=70)
  16.            System.out.println("乙!");
  17.            else if(x>=60)
  18.            System.out.println("丙!");
  19.            else if(x<60)
  20.            System.out.println("丁!");
  21.            
  22.      }
  23. }
複製代碼

TOP

返回列表