Pagini recente » Cod sursa (job #1935684) | Cod sursa (job #1709793) | Cod sursa (job #3279975) | Cod sursa (job #1637061) | Cod sursa (job #3184826)
# Open the input file containing two numbers, each on its own line.
with open("adunare.in", "r") as fin:
# Read the input file and split at linebreak, saving the resulting array.
content = fin.read().splitlines()
# Store the first two values.
a = int(content[0])
b = int(content[1])
# Open the output file for writing.
with open("adunare.out", "w") as fout:
# Write to the output file the string representation of the sum of the two values.
fout.write(str(a+b))