Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class LeapYear {
- public static void main (String[] args) {
- Scanner sc = new Scanner(System.in);
- int isLeapYear = sc.nextInt();
- boolean ans=new.ans();
- {
- if (isLeapYear % 4 == 0) or (isLeapYear % 4 == 0 && isLeapYear % 100 !== 0 && isLeapYear % 400 == 0) ans=true;
- {
- System.out.println(isLeapYear + " is a leap year.");
- }
- else ans=false;
- { (System.out.println(isLeapYear + " is not a leap year.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement