我只是在做一个程序,做以下事情
基本上: 输入:
8
12 12 16 102 47 16 102 47
输出:
4 102
问题是我的代码没有一个点,我也不知道问题出在哪里。 In在我的python中工作,但在某些在线编译器中不工作,因此接收者可能会遇到与在线站点相同的程序问题
def thing():
global count
count = int(input('n:'))
if count > 100000:
exit()
elif count < 1:
exit()
else:
wut()
def wut():
idk = []
inp = list(map(int,input('ai:').split(' ')))
if len(inp) != count:
exit()
elif sum(inp) > 200000:
exit()
elif sum(inp) < 1:
exit()
else:
for i in range(len(inp)):
for x in range(i+1, len(inp)):
if inp[i] == inp[x]:
idk.append(inp[i])
o = len(idk)
idk.sort(reverse = True)
print(o, idk[0])
thing()
在我的Python3.7.4中,它工作得很好,但我没有得到任何一点
collections.Counterfilter
相关问题 更多 >
编程相关推荐