返回列表 發帖
  1. import java.util.Scanner;


  2. public class Aa {

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub
  5.                 Scanner c = new Scanner(System.in);
  6.                 int a;
  7.                 System.out.print("請輸入年紀:");
  8.                 a = Integer.parseInt(c.nextLine());
  9.                 if(a>=18)
  10.                         System.out.print("可以考駕照了!");
  11.                 else
  12.                         System.out.print("未成年不可以考駕照!");

  13.         }

  14. }
複製代碼

TOP

返回列表