assigments

This commit is contained in:
2024-10-21 20:18:52 +03:00
parent 36c0d2e1b1
commit 8928b8471a
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import java.util.Scanner;
public class leapYear {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter year!");
int year = scan.nextInt();
if (year%4 == 0 || year%100 == 0 && year%400 == 0 && year > 1581) {
System.out.println("The year "+year+" is a leap year!");
} else if (year < 1582){
System.out.println("ENTER MORE THAN YEAR 1581!");
} else {
System.out.println("The year: "+year+" isn't leap year");
}
}
}