Enviado em 09/10/2018 - 15:54h
estacionamento = open("entrada.txt", "r")
vagas = estacionamento.readlines()
arrecadaValor = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
acumulaValor = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cont=0
for linha in vagas:
linha = linha.replace("\n","")
listaa = str.split(linha," ")
contVagas = len(listaa)
a=0
b=0
c=0
while a < contVagas:
listab = str.split(listaa[ a ],"-")
c =int(listab[0])
c -=1
if listab[0]=="0":
while b < 10:
arrecadaValor[ b ] += acumulaValor[ b ]
b += 1
elif listab[1] == "1":
acumulaValor[ c ] = 3
elif listab[1] == "2":
acumulaValor[ c ] = 5
elif listab[1] == "3":
acumulaValor[ c ] = 10
elif listab[1] == "0":
acumulaValor[ c ] = 0
a += 1
c = 0
if listab[0]!="0":
while b < 10:
arrecadaValor[ b ] += acumulaValor[ b ]
b += 1
contVagas=1
while contVagas <= 10:
print("{} - {}".format(contVagas, arrecadaValor[contVagas - 1]))
cont += arrecadaValor[contVagas-1]
contVagas+=1
print("TOTAL:{}".format(cont))
estacionamento.close()
Criar entrada (menuentry) ISO no Grub
Como gerar qualquer emoji ou símbolo unicode a partir do seu teclado
Instalar o VIM 9.1 no Debian 12
Como saber o range de um IP público?
Muitas dificuldades ao instalar distro Linux em Notebook Sony Vaio PCG-6131L (VPCEA24FM)
Slackpkg+ (Slackpkg Plus) está de volta!
Como dividir duas janelas igualmente e lado-a-lado na sua tela
Ocomon 6.0.1 - Problemas ao editar configurações estendidas (7)
instalar o Linux em computadores Acer novos (7)
Será possível instalar Linux Mint LMDE em Sony Vaio? (19)
O livro "Linux - Guia do Administrador do Sistema (Rubem E. Ferre... (1)