Long year: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add Draco) |
Not a robot (talk | contribs) (Add Cowgol) |
||
Line 1,228: | Line 1,228: | ||
1970 1976 1981 1987 1992 1998 2004 2009 2015 2020 2026 2032 2037 2043 2048 |
1970 1976 1981 1987 1992 1998 2004 2009 2015 2020 2026 2032 2037 2043 2048 |
||
2054 2060 2065 2071 2076 2082 2088 2093 2099)</pre> |
2054 2060 2065 2071 2076 2082 2088 2093 2099)</pre> |
||
=={{header|Cowgol}}== |
|||
<syntaxhighlight lang="cowgol">include "cowgol.coh"; |
|||
sub longyear(year: uint16): (r: uint8) is |
|||
sub p(y: uint16): (d: uint8) is |
|||
d := ((y + y/4 - y/100 + y/400) % 7) as uint8; |
|||
end sub; |
|||
r := 0; |
|||
if p(year) == 4 or p(year-1) == 3 then |
|||
r := 1; |
|||
end if; |
|||
end sub; |
|||
var year: uint16 := 2000; |
|||
while year <= 2100 loop |
|||
if longyear(year) != 0 then |
|||
print_i16(year); |
|||
print_nl(); |
|||
end if; |
|||
year := year + 1; |
|||
end loop;</syntaxhighlight> |
|||
{{out}} |
|||
<pre>2004 |
|||
2009 |
|||
2015 |
|||
2020 |
|||
2026 |
|||
2032 |
|||
2037 |
|||
2043 |
|||
2048 |
|||
2054 |
|||
2060 |
|||
2065 |
|||
2071 |
|||
2076 |
|||
2082 |
|||
2088 |
|||
2093 |
|||
2099</pre> |
|||
=={{header|Dc}}== |
=={{header|Dc}}== |