l=[] t=[] for m in range(4,1001): for n in range(1,m): if m%n==0: l.append(n) su=sum(l) if su==m: t.append(su) print t
慕村9548890
浏览 570回答 1
1回答
12345678_0001
l=[]t=[]for m in range(1,1001): for n in range(1,m): if m%n==0: l.append(n) su=sum(l) if su==m: t.append(su) l=[] #将计和列表清空print t