题解 | #完全数计算#
完全数计算
http://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
#遍历就完事了 while True: try: import math def yueshu(x): li = [] for i in range(1,x+1): if x % i == 0: li.append(i) #print(li) del li[-1] if sum(li) == x: return True n = int(input()) count = 0 for i in range(1,n+1): if yueshu(i): count += 1 print(count) except: break