题解 | #完全数计算#
完全数计算
https://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
n=int(input())
wqs=[]
for j in range(1,n+1):
zyz=[]
for i in range(1,j):
if j%i==0: zyz.append(i)
else: continue
#print(zyz)
if sum(zyz)==j: wqs.append(j)
else: continue
print(len(wqs))
#华为od#
wqs=[]
for j in range(1,n+1):
zyz=[]
for i in range(1,j):
if j%i==0: zyz.append(i)
else: continue
#print(zyz)
if sum(zyz)==j: wqs.append(j)
else: continue
print(len(wqs))