Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,17 @@
five_weekends:= proc()
local i, month, count;
#Only months with 31 days can possibly satisfy the condition
local long_months := [1,3,5,7,8,10,12];
local months := ["January","February","March","April","May","June","July","August","September","October","November","December"];
count := 0;
for i from 1900 to 2100 by 1 do
for month in long_months do
if Calendar:-DayOfWeek(Date(i, month, 1)) = 6 then
printf("%d-%s\n", i, months[month]);
count++;
end if;
end do;
end do;
printf("%d months have five full weekends.\n", count);
end proc;
five_weekends();