1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter an integer: "); 10 int number = input.nextInt(); 11 12 input.close(); 13 14 boolean judge = (number % 2 == 0); 15 16 System.out.println("Is " + number + " an even number? " + judge); 17 } 18 }
时间: 2024-10-20 02:42:43