-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeecrowd1066.py
53 lines (40 loc) · 1.16 KB
/
beecrowd1066.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Leia 5 valores Inteiros. A seguir mostre quantos valores digitados foram pares, quantos valores digitados foram ímpares, quantos valores digitados foram positivos e quantos valores digitados foram negativos.
Entrada
O arquivo de entrada contém 5 valores inteiros quaisquer.
Saída
Imprima a mensagem conforme o exemplo fornecido, uma mensagem por linha, não esquecendo o final de linha após cada uma.
"""
valor1 = float(input())
valor2 = float(input())
valor3 = float(input())
valor4 = float(input())
valor5 = float(input())
par = 0
impar = 0
positivo = 0
negativo = 0
valores = [valor1, valor2, valor3, valor4, valor5]
for valor in valores:
if (valor % 2 == 0):
par = par + 1
if (valor > 0):
positivo += 1
elif (valor < 0):
negativo += 1
else:
continue
elif (valor % 2 != 0):
impar += 1
if (valor > 0):
positivo += 1
elif (valor < 0):
negativo += 1
else:
continue
else:
continue
print('{} valor(es) par(es)'.format(par))
print('{} valor(es) impar(es)'.format(impar))
print('{} valor(es) positivo(s)'.format(positivo))
print('{} valor(es) negativo(s)'.format(negativo))