题解 | #完全数计算#
完全数计算
http://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
def is_PN(num):
i = 2
summ = 1
while i ** 2 <= num:
if num % i == 0:
summ += i
summ += num / i
i += 1
return summ == num
while True:
try:
countt = 0
for j in range(1, int(input())+ 1):
if is_PN(j):
countt += 1
print(countt - 1)
except:
break