返回列表 發帖
  1. import java.util.Scanner;
  2. public class Gg {

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub
  5.             Scanner c= new Scanner(System.in);
  6.             int age;
  7.             System.out.print("輸入年紀: ");
  8.             age=Integer.parseInt(c.nextLine());
  9.             if(age>=18)
  10.                 System.out.println("老司機,可以考駕照了!");
  11.             else
  12.                 System.out.println("菜鳥,再等等~~");
  13.         }

  14. }
複製代碼

TOP

返回列表