[python][백준/BOJ]
https://www.acmicpc.net/problem/9506 9506: 요인의 합 숫자 n은 자신을 제외한 모든 약수의 합과 같으면 완전수입니다. 예를 들어, 6은 6 = 1 + 2 + 3이기 때문에 완전수입니다. n이 완전수인지 여부를 결정하는 프로그램을 작성하십시오. www.acmicpc.net 반응형 while True: n=int(input()) if n ==-1: break l=list() for i in range(1,n//2+1): if n%i==0: l.append(i) if n==sum(l): print(“%d = ” %n, end=””) … Read more