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

  3. public class hihi {

  4.         public static void main(String[] args) {
  5.                 // TODO 自動產生的方法 Stub
  6.         Scanner c=new Scanner(System.in);
  7.         int age;
  8.         System.out.print("輸入年紀: ");
  9.         age=Integer.parseInt(c.nextLine());
  10.         if(age>=18)
  11.                 System.out.print("可以考駕照囉~");
  12.         else
  13.                 System.out.println("年齡還夠喔~");
  14.         }

  15. }
複製代碼

TOP

返回列表