Skip to content

Commit

Permalink
[#10] Feat: Add 약수들의 합
Browse files Browse the repository at this point in the history
  • Loading branch information
letsjo committed Mar 31, 2023
1 parent 0c8547e commit 7db8ff6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 9506.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 약수들의 합

while True:
n = int(input())
if (n == -1):
break
sum = 1
result = f'{n} = 1'
for i in range(2, n):
if (n % i == 0):
sum += i
result += f' + {i}'
if (sum == n):
print(result)
else:
print(f'{n} is NOT perfect.')

0 comments on commit 7db8ff6

Please sign in to comment.