TOPIC

Wrong Answer 30%

victorers2 asked 5 years ago

Recebi WA 30% e não sei em quais casos meu código falha, o que há de errado?

while True:
    try:
        a = input('') # Entrada
        saida = '' #String só com os algarismos

        for i in range(len(a)):
            if a[i] == 'o' or a[i] == 'O':
                saida += '0'
            elif a[i] == 'l':
                saida += '1'
            elif a[i].isdigit():
                saida += a[i]

        if not(saida == ''):
            saidaInt = int(saida) # conversão para evitar saídas como '01'
            if saidaInt > 2147483647:
                print('error')
            else:
                print(saidaInt)
        else: # saida é ''
            print('error')
    except EOFError:
        break

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

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