Import Java.util.Scanner; Public Class Leapyear {Public Static Void Main (String [] Arg) {Scanner Scan = New Scanner (System.in); System.out.println ("Please enter One year: "); Long year = scan.nextlong (); ifar%4 == 0 && Year%100! = 0 || Year%400 == 0) {system.out.println (year +"is a leap year"); .out.println (Year +"is not a leap year!");}}} Summarize:
1. The key is to judge the formula of the year of calculation. The leap year must meet two conditions: First: can be removed by 4, but cannot be removed by 100. Second: Can be removed by 400
2. Scanner class is used to receive input.