题解 | #完全数计算#
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
n = int(input()) def helper(x): res = [] for j in range(1, x): if x % j == 0: res.append(j) if res: if sum(res) == x: return True else: return False count = 0 for i in range(1, n + 1): if helper(i): count += 1 print(count)