1. 求第3大的数字,有重复:
Python代码:
a=['1','2','3','100','1','20','20']
b=[]
c=[]
for i in a:
if i not in b:
b.append(i)
for i in b:
if i not in c:
c.append(int(i))
c.sort()
1. 求第3大的数字,有重复:
Python代码:
a=['1','2','3','100','1','20','20']
b=[]
c=[]
for i in a:
if i not in b:
b.append(i)
for i in b:
if i not in c:
c.append(int(i))
c.sort()