Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Leap-year/Tcl/leap-year-1.tcl
Normal file
7
Task/Leap-year/Tcl/leap-year-1.tcl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
proc isleap1 {year} {
|
||||
return [expr {($year % 4 == 0) && (($year % 100 != 0) || ($year % 400 == 0))}]
|
||||
}
|
||||
isleap1 1988 ;# => 1
|
||||
isleap1 1989 ;# => 0
|
||||
isleap1 1900 ;# => 0
|
||||
isleap1 2000 ;# => 1
|
||||
7
Task/Leap-year/Tcl/leap-year-2.tcl
Normal file
7
Task/Leap-year/Tcl/leap-year-2.tcl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
proc isleap2 year {
|
||||
return [expr {[clock format [clock scan "$year-02-29" -format "%Y-%m-%d"] -format "%m-%d"] eq "02-29"}]
|
||||
}
|
||||
isleap2 1988 ;# => 1
|
||||
isleap2 1989 ;# => 0
|
||||
isleap2 1900 ;# => 0
|
||||
isleap2 2000 ;# => 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue