Refactoring
This commit is contained in:
parent
5442bbfd52
commit
eaf103a283
@ -26,14 +26,16 @@ function Problem19()
|
||||
|
||||
How many Sundays fell on the first of the month during the twentieth
|
||||
century (1 Jan 1901 to 31 Dec 2000)? =#
|
||||
|
||||
sundays = 0
|
||||
for y in 1901:2000
|
||||
for m in 1:12
|
||||
if Dates.dayofweek(Date(y, m, 1)) == Dates.Sunday
|
||||
for year = 1901:2000
|
||||
for month = 1:12
|
||||
if Dates.dayofweek(Date(year, month, 1)) == Dates.Sunday
|
||||
sundays += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return sundays
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user