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/Comma-quibbling/Nim/comma-quibbling.nim
Normal file
10
Task/Comma-quibbling/Nim/comma-quibbling.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
proc commaQuibble(s): string =
|
||||
result = ""
|
||||
for i, c in s:
|
||||
if i > 0: result.add (if i < s.high: ", " else: " and ")
|
||||
result.add c
|
||||
result = "{" & result & "}"
|
||||
|
||||
var s = @[@[], @["ABC"], @["ABC", "DEF"], @["ABC", "DEF", "G", "H"]]
|
||||
for i in s:
|
||||
echo commaQuibble(i)
|
||||
Loading…
Add table
Add a link
Reference in a new issue