Created
November 26, 2011 05:32
-
-
Save Quby/1395095 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keyboard = {} | |
keys = "oqz,ij,abc,def,gh,kl,mn,prs,tuv,wxy".split(",") | |
k = 0 | |
for x in keys: | |
for c in x: | |
keyboard[c] = k | |
k = k + 1 | |
def toNumbers(x): | |
return [keyboard[c] for c in x] | |
def extract (number, words, nwords): | |
pass | |
input = open("input.txt", "r") | |
output = open("output.txt", "w") | |
while (True): | |
number = input.readline() | |
if number == "-1" : break | |
words = [input.readline() for x in range(1, int(input.readline()))] | |
nwords = [toNumbers(x) for x in words] | |
output.writeline(extract(number, words, nwords)) | |
output.close() | |
input.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment