View Code of Problem 28

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

public class Main {
//    public static void main(String[] args) {
//        Scanner scanner=new Scanner(System.in);
//        while (scanner.hasNext()){
//            long n=scanner.nextLong();
//            if(n%100!=0&&n%4==0){
//                System.out.println("Leap Year");
//            }
//            else if(n%400==0){
//                System.out.println("Leap Year");
//            }
//            else {
//                System.out.println("Not Leap Year");
//            }
//        }
//
//    }


        public static void main(String[] args) throws NumberFormatException, IOException {
            BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
           
            while(bf.read()!=-1) {
                String s=bf.readLine();
                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");
                }
            }

        }


}

Double click to view unformatted code.


Back to problem 28