You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
648 B
Python
16 lines
648 B
Python
inp = open("input.txt", "w")
|
|
out = open("output.txt", "w")
|
|
add2 = open("Addent.txt").readlines()
|
|
add1 = open("Augent.txt").readlines()
|
|
ins = open("insert.txt").readlines()
|
|
num = open("Number.txt").readlines()
|
|
pos = open("Position.txt").readlines()
|
|
out.write("{}\n".format(len(add1) * 2))
|
|
for ln in zip(add1, add2):
|
|
inp.write("1 {} {}\n".format(ln[0].strip(), ln[1].strip()))
|
|
out.write("{}\n".format(int(ln[0]) + int(ln[1])))
|
|
for ln in zip(add1, pos, num, ins):
|
|
inp.write("2 {} {} {}\n".format(ln[0].strip(), ln[1].strip(),
|
|
ln[2].strip()))
|
|
out.write("{}\n".format(ln[3].strip().replace(',', '')))
|