TOPIC

RUNTIME ERROR (HELP!)

Andrey Rosa asked 11 months ago

Olá, estou ficando louco, já tentei dar sumbit nesse codigo de diversar formar, mas ele dá Runtime error(abaixo do codigo o erro). Ja tentei diveras coisas, colocar tudo na msm linha o input e a tipagem, usar raw_input... enfim não sei mais o que fazer, pois na ide da pycharm roda o code e aqui no site não :( Hello, i'm confuse, when a run this code in ide its works, but when i do submit here its break.... i tride many whays to get input, like "raw_input, use flot type....

Traceback (most recent call last): File "Main.py", line 2, in x1 = int(x1) ValueError: invalid literal for int() with base 10: '1 1 1 1' Command exited with non-zero status (1)

x1 = input() x1 = int(x1)

while (x1 <= 0 or x1 > 8): x = input() x1 = int(x1)

y1 = (input()) y1 = int(y1) while (y1 <= 0 or y1 > 8): y1 = (input()) y1 = int(y1)

x2 = (input()) x2 = int(x2) while (x2 <= 0 or x2 > 8): x2 = (input()) x2 = int(x2)

y2 = (input()) y2 = int(y2) while (y2 <= 0 or y2 > 8): y2 = (input()) y2 = int(y2) aux = 0 diferenceLine = 0 diferenceRow = 0 plays = 0

if (x1 != x2 or y1 != y2): diferenceLine = x1 - x2 if diferenceLine < 0: diferenceLine = diferenceLine * (-1)

diferenceRow = y1 - y2
if diferenceRow < 0:
    diferenceRow = diferenceRow * (-1)

if diferenceLine > diferenceRow:
    aux = diferenceLine - diferenceRow

if diferenceRow > diferenceLine:
    aux = diferenceRow - diferenceLine

plays = aux + 1
print( plays)

if(x1 == x2 and y1 == y2): print(0)

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.