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
10
Task/Executable-library/Nim/executable-library-2.nim
Normal file
10
Task/Executable-library/Nim/executable-library-2.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import hailstone, tables
|
||||
|
||||
var t = initCountTable[int]()
|
||||
|
||||
for i in 1 .. <100_000:
|
||||
t.inc(hailstone(i).len)
|
||||
|
||||
let (val, cnt) = t.largest()
|
||||
echo "The length of hailstone sequence that is most common for"
|
||||
echo "hailstone(n) where 1<=n<100000, is ", val, ". It occurs ", cnt, " times."
|
||||
Loading…
Add table
Add a link
Reference in a new issue