Leap year: Difference between revisions
→{{header|K}}: Note K3 dialect, reformat, extend
m (Formatting RPL section) |
(→{{header|K}}: Note K3 dialect, reformat, extend) |
||
Line 2,184:
=={{header|K}}==
=== K3 ===
<syntaxhighlight lang="k"> leapyear:{(+/~x!'4 100 400)!2}▼
Leap year test:
Testing a range of years:
<syntaxhighlight lang="k"> leapyear'1996+!6
1 0 0 0 1 0</syntaxhighlight>
Leap year selection:
<syntaxhighlight lang="k"> leapyears:{a@&leapyear'a:x}</syntaxhighlight>
Selecting leap years from a list:
<syntaxhighlight lang="k"> leapyears@1900,1994,1996,1997,2000
1996 2000</syntaxhighlight>
|