Leap year: Difference between revisions
Content deleted Content added
C: optimize, extend tests |
add an implementation for sed |
||
Line 3,296:
(map (lambda (m) (zero? (remainder n m)))
'(400 100 4))))</syntaxhighlight>
=={{header|sed}}==
<syntaxhighlight lang="sed">h
s/00$//
/[02468][048]$/!{
/[13579][26]$/!d
}
g
s/$/ is a leap year/</syntaxhighlight>
Test:
<pre>
$ seq 1900 2100 | sed -f leap.sed
1904 is a leap year
1908 is a leap year
1912 is a leap year
...
</pre>
=={{header|Seed7}}==
|