1
I’m practicing some examples in the URI Online Judge and I’ve come up with this example:
And I tried the following solution:
numeros = input().split();
N1, N2, N3, N4 = float(numeros[0]), float(numeros[1]), float(numeros[2]), float(numeros[3])
NotaExame = float(input())
M = (N1 * 2 + N2 * 3 + N3 * 4 + N4) / 10
print("Media:", M)
if M >= 7:
print("Aluno aprovado.")
elif M < 5:
print("Aluno reprovado.")
elif 5 <= M <= 6.9:
print("Aluno em exame.")
print("Nota do exame:", NotaExame)
NovaMedia = (M + NotaExame) / 2
if NovaMedia >= 5:
print("Aluno aprovado.")
else:
print("Aluno reprovado.")
print("Media final:", NovaMedia)
However, I got the following error on line 4:
RUNTIME ERROR
Traceback (most recent call last):
File "Main.py", line 4, in
NotaExame = float(input())
EOFError: EOF when reading a line
The URI is very rigid in its inputs and outputs identical to how it wishes.
I put that Notaexame why put inside the elif
line 13 (Because the example leaves to understand that this entry is to occur only if the student stay in condition to perform the exam) eventually resulting in Wrong Answer (5%), so I thought I’d try to fix the Runtime Error, that I believe is closer to the result.
Friend, I will soon test your solution. I did not send the link, because to be able to perform the test and submit, there must be an account in the URI, but follow the link: https://www.urionlinejudge.com.br/judge/pt/problems/view/1040
– Afuro Terumi