Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
//use Java's calendar class
new java.util.GregorianCalendar().isLeapYear(year)

View file

@ -0,0 +1 @@
java.time.LocalDate.ofYearDay(year, 1).isLeapYear()

View file

@ -0,0 +1,8 @@
def isLeapYear(year:Int)=if (year%100==0) year%400==0 else year%4==0;
//or use Java's calendar class
def isLeapYear(year:Int):Boolean = {
val c = new java.util.GregorianCalendar
c.setGregorianChange(new java.util.Date(Long.MinValue))
c.isLeapYear(year)
}