import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner=new Scanner(System.in); while(scanner.hasNext()) { int y=scanner.nextInt(); if(y%4==0&&y%100!=0) { System.out.println("Leap Year"); } else if(y%400==0&&y%100==0) { System.out.println("Leap Year"); } else { System.out.println("Not Leap Year"); } } } } |
Double click to view unformatted code.