返回列表 發帖
  1. import java.io.Console;
  2. public class Test
  3. {
  4.   public static void main(String args[])
  5.   {
  6.     Console c=System.console();
  7.     int x;
  8.     x=Integer.parseInt(c.readLine("請輸入x"));

  9.     if(100>=x&&x>=90)
  10.         System.out.println("優");
  11.     else if(90>x&&x>=80)
  12.         System.out.println("甲");
  13.     else if(80>x&&x>=70)
  14.         System.out.println("乙");
  15.     else if(70>x&&x>=60)
  16.         System.out.println("丙");
  17.     else if(60>x&&x>=0)
  18.         System.out.println("丁");
  19.   }

  20. }
複製代碼

TOP

返回列表