View Code of Problem 28

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {	
		int year;
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()) {
			year = scan.nextInt();
			if(year%400==0||(year%4==0&&year%100!=0)) {
				System.out.println("Leap Year");
			}
			else {
				System.out.println("Not Leap Year");
			}
		}
		scan.close();
		}
}

Double click to view unformatted code.


Back to problem 28