题解 | #完全数计算#
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
m = int(input()) count = 0 for i in range(2, m): j = 1 for k in range(2, int(i**(1/2) + 1), 1): if i % k == 0: # 一次找出俩因子 if i // k == k: j += k else: j += k + i // k if i == j: count += 1 print(count)