diff --git a/src/Task6.java b/src/Task6.java new file mode 100644 index 0000000..0b18c1f --- /dev/null +++ b/src/Task6.java @@ -0,0 +1,18 @@ +import java.util.Scanner; +public class Main { + public static void main(String[] args) { + System.out.println("Задание №6"); + Scanner scan = new Scanner(System.in); + int daysInYear = 0; + System.out.println("Введите год - "); + int year = scan.nextInt(); + if (year % 4 == 0 && (year % 400 == 0 || year % 100 != 0)) { + System.out.println("Високосный год"); + daysInYear = 366; + } else { + System.out.println("Невисокосный год"); + daysInYear = 365; + } + System.out.println("В году " + year + " дней - " + daysInYear); + } +}