See code below.
I've tried running it with a variety of years, both leap and non leap; ones that are divisable with 400, 100 and 4. I get the right answer but the last requirement is never met.
Thanks in advance.
package com.codegym.task.task04.task0414;
/*
Number of days in the year
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader bR = new BufferedReader(new InputStreamReader(System.in));
int x = Integer.parseInt(bR.readLine());
if (x % 400 == 0) {
x = 366;
} else if (x % 100 == 0) {
x = 365;
} else if (x % 4 == 0) {
x = 366;
}
System.out.println("Number of days in the year: " + x);
}
}