TOPIC

Run time error Python3

Leonardo Gideão Costa Rocha asked 1 year ago

n = int(input())
vet = [0]*n
for x in range(0,n):
    vet[x] = int(input())
b = [0]*n
for x in range(0,n):
    if x == 0:
        b[x] = vet[x+1]
        if vet[x] == 1:
            b[x] += 1
    elif x == n-1:
        b[x] = vet[x-1]
        if vet[x] == 1:
            b[x] += 1
    else:
        b[x] = vet[x-1]+vet[x+1]
        if vet[x] == 1:
            b[x] += 1
for x in range(0,n):
    print(b[x])

No meu compilador não apresentou problema algum, mas quando passo para o site diz runtime error

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

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