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

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub
  5.                 int y;
  6.                 Scanner c =new Scanner(System.in);
  7.                 System.out.println("請輸入年齡");
  8.                 y=c.nextInt();
  9.                 if(y>=18)
  10.                 {
  11.                         System.out.print("可以考駕照");
  12.                 }
  13.                 else
  14.                 {
  15.                         System.out.print("不能考駕照");
  16.                 }
  17.         }

  18. }
複製代碼

TOP

返回列表