返回列表 發帖
  1. import java.lang.*;       //類別庫,常用,自動載入,可忽略
  2. import java.io.Console;  // 抓使用者key 鍵盤時會用到
  3. public class ch08//類別
  4. {
  5.   public static void main (String arg[]) //方法
  6.   {
  7.     Console cs=System.console();  //宣告cs
  8.     int score;
  9.     System.out.print("請輸入你的分數 :");
  10.     score=Integer.parseInt(cs.readLine());
  11.     if (score==100)
  12.     {
  13.       System.out.print("哇 您真是太厲害了 滿分耶!");

  14.     }else if (score<100 && score>=60 )
  15.     {
  16.       System.out.print("及格了唷!");
  17.     }else if (score>0 && score <60)
  18.     {
  19.       System.out.print("下次再加油 好嗎?");
  20.     }else if (score==0)
  21.     {
  22.       System.out.print("零分...");
  23.     }else
  24.      {
  25.       System.out.print("嘿! 不要亂輸入唷");
  26.      }
  27.   }
  28. }
複製代碼

TOP

返回列表