题解 | #完全数计算#
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
def perf(n): res=[] for i in range(1,n//2+1): if n%i==0: res.append(i) if sum(res)==n: return 1 else: return 0 while 1: try: n=int(input()) ans=0 for i in range(6,n+1): if perf(i): ans+=1 print(ans) except: break