// Arup Guha
// 7/8/04 - This program prompts the user for a positive year and
//          determines whether it is a leap year or not.

import java.util.*;

public class Leapyear {

    public static void main(String argv[]) {

	Scanner stdin = new Scanner(System.in);

	int year; 
	boolean result; // set to true if year is a leap year, false otherwise.

	// Reads in a year from the user.
	System.out.println("Enter a year: ");
	year = stdin.nextInt();

	// Checks if year is not divisible by 4.
	if (year%4 != 0)
	    result = false;
	else {
	    // In this case, a year is a leap year, unless it is NOT
        // divisible by 400, but is divisible by 100.
	    if (year%100 == 0 && year%400 != 0) {
	    	result = false;
	    }
	    else {
			result = true;
		}
	}
	
	
	// Outputs result to the screen.
	if (result)
	    System.out.println("The year " + year + " was a leap year.");
	else
	    System.out.println("The year " + year + " was not a leap year.");
    }

}
