Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Long-year/Java/long-year.java
Normal file
19
Task/Long-year/Java/long-year.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import java.time.LocalDate;
|
||||
import java.time.temporal.WeekFields;
|
||||
|
||||
public class LongYear {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.printf("Long years this century:%n");
|
||||
for (int year = 2000 ; year < 2100 ; year++ ) {
|
||||
if ( longYear(year) ) {
|
||||
System.out.print(year + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean longYear(int year) {
|
||||
return LocalDate.of(year, 12, 28).get(WeekFields.ISO.weekOfYear()) == 53;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue