12 lines
311 B
Plaintext
12 lines
311 B
Plaintext
include hail.exw
|
|
|
|
sequence counts = {}
|
|
for i=1 to 100000 do
|
|
integer l = hailstone_count(i)
|
|
if length(counts)<l then
|
|
counts &= repeat(0,l-length(counts))
|
|
end if
|
|
counts[l] += 1
|
|
end for
|
|
printf(1,"The hailstone length returned most often between 1 and 100,000 is %d.\n",{largest(counts,1)})
|