题解 | #完全数计算#
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
n=int(input()) s=0 for i in range(1,n,1): a=0 for j in range(1,i,1): if i%j==0: a=a+j if a==i: s=s+1 print(s)
差点超时了
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
n=int(input()) s=0 for i in range(1,n,1): a=0 for j in range(1,i,1): if i%j==0: a=a+j if a==i: s=s+1 print(s)
差点超时了
相关推荐