求 1~20 中 完全数 (真因子和等于自身),程序输出()
for n in range(1,21): s = 0 for i in range(1,n): if n%i ==0: s +=i if s ==n: print(n, end=' ')
6 12
6 28
6
12