• 0
Sign in to follow this  
daniellygj

não consigo terminar esse codigo :c

Question

estou tentando fazer o exercicio 1220 do uri. segue o link para verem o enunciado 

https://www.urionlinejudge.com.br/judge/pt/problems/view/1220

 

eis o meu codigo: 

# 1220
qtd = int(input())
if qtd < 0 or qtd > 1000:
    qtd = int(input())
vet = []
vet1 = []
soma = 0
soma1 = 0
for c in range(0, qtd):
    vet.append(float(input()))
    if vet[c] > 10000.00:
        vet = float(input())

qtd1 = int(input())
if qtd1 < 0 or qtd > 1000:
    qtd1 = int(input())

entrada = 1
while entrada != 0:
    entrada = float(input())
    if entrada != 0:
        vet1.append(entrada)

for c in range(0, qtd):
    vet = sorted(vet)
    soma += vet[c]
soma /= qtd
result = vet[qtd - 1] - soma
print("$%.2f" %result)

for c in range(0, qtd1):
    vet1 = sorted(vet1)
    soma1 += vet1[c]

x = len(vet1) -1
soma1 /= qtd
print('soma1',soma1)
result1 = vet1[x] - soma1

print("$%.2f" %result1)

 

não consigo fazer a segunda saida do jeito correto. poderiam me ajuda por favor? obrigada

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this