import java.util.Scanner; public class Demo { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); System.out.print("Please input positive number:"); int input = scanner.nextInt(); if (input > 0){ System.out.println("Number: " + input); } else { assert (input > 0): "執行有誤...."; System.out.println("Error : " + input); } } }