Switch to nanoc
This commit is contained in:
parent
64313ec3ce
commit
6bfe583522
24 changed files with 307 additions and 74 deletions
|
|
@ -1,20 +0,0 @@
|
|||
Nimrod is a powerful statically typed language that allows the programmer expressiveness without compromising run-time performance.
|
||||
|
||||
``` nimrod
|
||||
import tables, strutils
|
||||
|
||||
var wordFrequencies = initTable[string, int]
|
||||
|
||||
for line in stdin.lines:
|
||||
for word in line.split(", "):
|
||||
wordFrequencies[word] += 1
|
||||
|
||||
var maxFrequency = 0
|
||||
var mostFrequentWord: string
|
||||
for word, frequency in wordFrequencies:
|
||||
if frequency > maxFrequency:
|
||||
maxFrequency = frequency
|
||||
mostFrequentWord = word
|
||||
|
||||
echo "The most frequent word is '", word, "'"
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue