题解 | #完全数计算#
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
def daidai(a): list1 = [1] for i in range(2,a): if a % i==0: list1.extend([i]) return list1 n = int(input()) list2 = [] for i in range(2,n): miao = daidai(i) q = 0 for j in range(len(miao)): q += miao[j] if q == i: list2.append(i) print(len(list2))