Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
18
Task/Five-weekends/Ring/five-weekends.ring
Normal file
18
Task/Five-weekends/Ring/five-weekends.ring
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
sum = 0
|
||||
month = list(12)
|
||||
mo = [4,0,0,3,5,1,3,6,2,4,0,2]
|
||||
mon = [31,28,31,30,31,30,31,31,30,31,30,31]
|
||||
mont = ["January","February","March","April","May","June",
|
||||
"July","August","September","October","November","December"]
|
||||
for year = 1900 to 2100
|
||||
if year < 2100 leap = year - 1900 else leap = year - 1904 ok
|
||||
m = ((year-1900)%7) + floor(leap/4) % 7
|
||||
oldsum = sum
|
||||
for n = 1 to 12
|
||||
month[n] = (mo[n] + m) % 7
|
||||
x = (month[n] + 1) % 7
|
||||
if x = 2 and mon[n] = 31 sum += 1 see "" + year + "-" + mont[n] + nl ok
|
||||
next
|
||||
if sum = oldsum see "" + year + "-" + "(none)" + nl ok
|
||||
next
|
||||
see "Total : " + sum + nl
|
||||
Loading…
Add table
Add a link
Reference in a new issue