[Java]
/* (Start of program header annotation) </p> <p> * copyright and version Declaration of the program
* Copyright (c) 2011, a student from the computer College of Yantai University
* Author: Li Zhaoqing
* Completion date: January 1, September 22, 2012
* Input description:
* Problem description and output: run java: enter a year on the keyboard to determine whether it is a leap year.
* End the comment in the program Header
*/
Import javax. swing. JOptionPane;
Public class Num {
/**
* @ Param args
*/
Public static void main (String [] args ){
// TODO Auto-generated method stub
String str = JOptionPane. showInputDialog ("Enter the year to be determined ;");
Int y = Integer. parseInt (str );
System. out. println ("the year you entered is:" + y );
If (jud (y ))
{
System. out. println (y + "is a leap year .");
}
Else
{
System. out. println (y + "not a leap year ");
}
}
Public static boolean jud (int y)
{
If (y % 400 = 0 | y % 4 = 0 & y % 100! = 0)
{
Return true;
}
Else
{
Return false;
}
}
}