n = int(input(“输入一个整数”))
sum = 0
for i in range(1, n - 1):
if n % i == 0:
sum += i
if sum == n:
break
else:
print(0)
exit(1)
print(n)
n = int(input(“输入一个整数”))
sum = 0
i = 1
while i <= n - 1:
if n % i == 0:
sum += i
i += 1
if sum == n:
print(n, “是完数”)
else:
print(n, “不是完数”)