Skip to content
Snippets Groups Projects
map1.py 496 B
import sys
def map1(vote_str):
    ret = ""
    vote = vote_str.split("==")
    vote = [v.strip() for v in vote]
    test_ret = ""
    for i in range(0, len(vote) - 1):
        for j in range(i + 1, len(vote)):
            ret = ""
            if vote[i] > vote[j]:
                ret = vote[i] + ">" + vote[j] + ",1"
            else:
                ret = vote[j] + ">" + vote[i] + ",0"
            print(ret)
with open(sys.argv[1]) as f:
    lines = f.readlines()
for l in lines:
    map1(l)