Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class a004 {
- public static void leap()
- {
- System.out.println("閏年");
- }
- public static void ordinary()
- {
- System.out.println("平年");
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner input=new Scanner(System.in);
- while(input.hasNext())
- {
- int year=input.nextInt();
- if(year%400==0)
- leap();
- else if(year%100==0)
- ordinary();
- else if(year%4==0)
- leap();
- else
- ordinary();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement