azure011328

导航

 

package org.example;

public class YearChecker {
public boolean isLeapYear(int year) {
if (year <= 0) {
throw new IllegalArgumentException("Year must be positive");
}
if (year % 4 != 0) {
return false;
} else if (year % 100 != 0) {
return true;
} else {
return year % 400 == 0;
}
}
}

posted on 2025-06-11 08:54  淮竹i  阅读(9)  评论(0)    收藏  举报