View Code of Problem 28

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String s = bf.readLine();
		if(s!=null)
		do {
			int year = Integer.valueOf(s);
			if((year % 4 == 0 && year % 100 != 0) || 
					year % 400 == 0) {
				System.out.println("Leap Year");
			}else {
				System.out.println("Not Leap Year");
			}
			s = bf.readLine();
		}while(s!=null);

	}

}

Double click to view unformatted code.


Back to problem 28