728x90
SMALL
브루트포스 알고리즘 사용하는 것 !! 완전탐색 !!!
n = int(input())
result = 0
for i in range(1,n+1):
arr = list(map(int,str(i)))
final= i+sum(arr)
if final == n:
result=i
break
print(result)
728x90
LIST
'취준시절 > 백준' 카테고리의 다른 글
[백준 2798] Python - 블랙잭 (0) | 2021.08.26 |
---|---|
[백준 2309] Python - 일곱 난쟁이 (0) | 2021.08.26 |
[백준 1780] Python - 종이의 개수 (0) | 2021.08.25 |
[백준 1991] Python - 트리 순회 (0) | 2021.08.25 |
[백준 2630] Python - 색종이 만들기 (0) | 2021.08.25 |