题解 | #完全数计算#
完全数计算
http://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
def perfectNumber(n): s = 0 for i in range(1,int(n**0.5)+1): if n % i == 0: a = n/i s += i s += a if s == 2*n: return True else: return False while True: try: n = int(input()) t = 0 for i in range(6,n): if perfectNumber(i): # print(i) t += 1 print(t) except: break