Long year: Difference between revisions

Line 2,616:
Long years in the 22nd century:
[2105, 2111, 2116, 2122, 2128, 2133, 2139, 2144, 2150, 2156, 2161, 2167, 2172, 2178, 2184, 2189, 2195]
</pre>
 
=={{header|XPL0}}==
{{trans|Commodore BASIC}}
{{works with|EXPL-32}}
<lang xpl0>
\Long year
code Rem=2, CrLf=9, IntIn=10, IntOut=11, Text=12, Clear=40;
integer S, E, Y;
function integer Weekday(Y);
\Weekday of Y-12-31, 0 Sunday
integer Y;
return Rem((Y + (Y / 4) - (Y / 100) + (Y / 400)) / 7);
 
function integer IsLongYear(Y);
integer Y;
return (4 = Weekday(Y) ! 3 = Weekday(Y - 1));
 
begin
Clear;
Text(0, "**** List of ISO long years ****");
CrLf(0);
Text(0, "Start year: "); S:= IntIn(0);
Text(0, "End year: "); E:= IntIn(0);
CrLf(0);
for Y:= S, E do
if IsLongYear(Y) then [IntOut(0, Y); Text(0, " ")];
CrLf(0);
end
</lang>
{{out}}
<pre>
**** List of ISO long years ****
Start year: 1995
End year: 2045
 
1998 2004 2009 2015 2020 2026 2032 2037 2043
</pre>
 
Anonymous user