-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPraktikum.java
More file actions
30 lines (25 loc) · 781 Bytes
/
Praktikum.java
File metadata and controls
30 lines (25 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.sql.SQLOutput;
import java.util.Scanner;
public class Praktikum {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Введите год:");
int year = scanner.nextInt();
if (isLeapYear(year)) {
System.out.println("12.09." + year);// здесь нужно вывести результат
} else {
System.out.println("13.09." + year);
}
}
public static boolean isLeapYear(int year) {
if (year % 400 == 0) {
return true;
} else if (year % 100 == 0) {
return true;
} else if (year % 4 == 0) {
return false;
} else {
return false;
}
}
}