Enter the year to determine whether it is a leap year
Import java. Io. *; // public class required for Import
/** Leapyear */
Public class leapyear {
/** Main () method */
Public static void main (string ARGs []) throws ioexception {
// The following seven rows of statements are used to store the input year from the keyboard to the year variable.
Inputstreamreader IR;
Bufferedreader in;
IR = new inputstreamreader (system. In );
In = new bufferedreader (IR );
System. Out. println ("Please input a year :");
String S = in. Readline ();
Int year = integer. parseint (s );
// The following uses the IF-else structure to determine whether the year in year is a leap year.
If (Year % 4 = 0 & amp; Year % 100! = 0 | year % 400 = 0)
{
System. Out. println ("year" + year + "is a leap year .");
}
Else
{
System. Out. println ("year" + year + "is not a leap year .");
}
}
}