3998 - Sum Max 9
Rezolvare
<syntaxhighlight lang="python" line="1"> n = int(input("Introduceti numarul de perechi: ")) perechi = [] for i in range(n):
a, b = map(int, input(f"Introduceti perechea {i+1}: ").split()) perechi.append((a, b))
suma_maxima = 0 for a, b in perechi:
suma_maxima += max(a, b)
print(f"Suma maxima este: {suma_maxima}") </syntaxhighlight>