Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Day-of-the-week/Java/day-of-the-week.java
Normal file
20
Task/Day-of-the-week/Java/day-of-the-week.java
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import static java.util.Calendar.*;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
public class Yuletide{
|
||||
public static void main(String[] args) {
|
||||
Calendar calendar;
|
||||
int count = 1;
|
||||
for (int year = 2008; year <= 2121; year++) {
|
||||
calendar = new GregorianCalendar(year, DECEMBER, 25);
|
||||
if (calendar.get(DAY_OF_WEEK) == SUNDAY) {
|
||||
if (count != 1)
|
||||
System.out.print(", ");
|
||||
System.out.printf("%d", calendar.get(YEAR));
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue