TOPIC
Im dying to know whats the problem with the code.
mambalkhair asked 2 years ago
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextLong()) {
long year = in.nextLong();
int num_of_days = 365;
boolean[] array = {false, false, false, false};
if (year >= 2000) {
if (year % 4 == 0 && year % 100 != 0) {
System.out.println("This is leap year.");;
// if (year % 15 == 0) System.out.println("This is huluculu festival year.");
// if (year % 55 == 0) System.out.println("This is bulukulu festival year.");
} //here if the number is divisible by 400 and 100 it shall be a leap year
else if (year % 100 == 0 && year % 400 == 0) {
System.out.println("This is leap year.");;
// if (year % 15 == 0) System.out.println("This is huluculu festival year.");
// if (year % 55 == 0) System.out.println("This is bulukulu festival year.");
} else {
System.out.println("This is an ordinary year.");
}
if (year % 15 == 0) {
System.out.println("This is huluculu festival year.");
}
if (year % 55 == 0) {
System.out.println("This is bulukulu festival year.");
}
System.out.println();
//here if the number doesn't met the conditions upside
//then we try dividing by 4.. if it's divisible its a leap year then
}
}
}
}