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
12
Task/Multiplication-tables/Nim/multiplication-tables.nim
Normal file
12
Task/Multiplication-tables/Nim/multiplication-tables.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import strfmt
|
||||
|
||||
const n = 12
|
||||
|
||||
for j in 1..n:
|
||||
stdout.write "{:3d}{:s}".fmt(j, if n-j>0: " " else: "\n")
|
||||
for j in 0..n:
|
||||
stdout.write if n-j>0: "----" else: "+\n"
|
||||
for i in 1..n:
|
||||
for j in 1..n:
|
||||
stdout.write if j<i: " " else: "{:3d} ".fmt(i*j)
|
||||
echo "| {:2d}".fmt(i)
|
||||
Loading…
Add table
Add a link
Reference in a new issue