整数的个数:输入格式怎么表示
num = input("")x = []
count1 = 0
count5 =0
count10 =0
for i in range(int(num)):
teep = input("")
x.append(teep)
for j in range(int(num)):
if j == 1:
count1 += 1
elif j == 5:
count5 += 1
elif j ==10:
count += 1
print(count1)
print(count5)
print(count10)
这个输入的格式怎么搞啊。。。不太会 字符串分割
k = int(input())
n1, n5, n10 = 0, 0, 0
list1 = list(map(int, (input()).split(" "))) #映射为int类型
for i in range(len(list1)):
if(list1 == 1):
n1 += 1
if(list1 == 5):
n5 += 1
if (list1 == 10):
n10 += 1
print(n1, n5, n10) k = input('')
temp = input('')
lst =
print(lst.count(1),lst.count(5),lst.count(10),sep='\n')
页:
[1]