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