n = int(input())
s = []
result = [0,0,0]
for i in range(n):
k = int(input())
while not (-10000 < k < 10000):
k = int(input("Out of range. Repeat: "))
s.append(k)
for i in s:
if i > 0:
result[0] += 1
elif i < 0:
result[1] += 1
elif i == 0:
result[2] += 1
for i in result:
print(i, end=" ")
5
3
4
-4
-2
0
2 2 1
Поделитесь своими знаниями, ответьте на вопрос:
А10=6234 напишите в таблице
n = int(input())
s = []
result = [0,0,0]
for i in range(n):
k = int(input())
while not (-10000 < k < 10000):
k = int(input("Out of range. Repeat: "))
s.append(k)
for i in s:
if i > 0:
result[0] += 1
elif i < 0:
result[1] += 1
elif i == 0:
result[2] += 1
for i in result:
print(i, end=" ")
Ввод/Вывод:5
3
4
-4
-2
0
2 2 1