Advertisement
john2054

LeapYear

Oct 7th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class LeapYear {
  3.     public static void main (String[] args) {
  4.           Scanner sc = new Scanner(System.in);
  5.     int isLeapYear = sc.nextInt();
  6.     boolean ans=new.ans();
  7.     {
  8.  if (isLeapYear % 4 == 0) or (isLeapYear % 4 == 0 && isLeapYear % 100 !== 0 && isLeapYear % 400 == 0) ans=true;
  9.    
  10.    {
  11.   System.out.println(isLeapYear + " is a leap year.");
  12.  }
  13.   else ans=false;
  14.   { (System.out.println(isLeapYear + " is not a leap year.");
  15.      
  16.      }
  17.  }
  18.  }
  19.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement