U E D R , A S I H C RSS

Code Race/20060105/Leonardong

~cpp
f = file("Alice.txt", 'r')
def cut(word):
    for mark in ''',.'():;~=-?!`''':
        word = word.replace(mark,"")
    return word

result = {}
for word in f.read().split():
    word = cut(word)
    if word in result.keys():
        result[word] +=1
    else:
        result[word] = 1

report = list()
for word, count in result.items():
    report.append((word, count))

report.sort()
def asciiSum(word):
    return 0

for each in report:
    print each[0], each[1], asciiSum(each[0])
f.close()
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-05-27 07:09:19
Processing time 0.0836 sec