题解 | #完全数计算#
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
n = int(input()) re = [] for i in range(2, n+1): re_yz = [1,] for j in range(2, int(i**0.5) + 1): if i % j == 0: re_yz.append(j) re_yz.append(int(i/j)) if sum(re_yz) == i: re.append(i) print(len(re))