Cod sursa(job #3332379)

Utilizator Dope_GuyDaniel Jicu Dope_Guy Data 6 ianuarie 2026 13:49:13
Problema A+B Scor 0
Compilator py Status done
Runda Arhiva de probleme Marime 0.41 kb
import sys

try:
    with open("adunare.in", "r") as fin:
        data = fin.read()
except FileNotFoundError:
    data = sys.stdin.read()

a, b = map(int, data.split())
ans = a + b

# scrie pentru evaluator (stdout)
print(ans)

# scrie și în fișier, dacă există cerința cu fișiere
try:
    with open("adunare.out", "w") as fout:
        fout.write(str(ans) + "\n")
except OSError:
    pass