15 lines
432 B
Text
15 lines
432 B
Text
proc nonrec leap_year(word year) bool:
|
|
year%400=0 or (year%4=0 and year%100/=0)
|
|
corp
|
|
|
|
proc nonrec main() void:
|
|
[15]word years = (1899, 1900, 1901, 1902, 1903, 1904, 1905, 1999,
|
|
2000, 2001, 2002, 2003, 2004, 2021, 2022);
|
|
word i;
|
|
|
|
for i from 0 upto 14 do
|
|
writeln(years[i],
|
|
if leap_year(years[i]) then " is " else " is not " fi,
|
|
"a leap year.")
|
|
od
|
|
corp
|