지나가던 개발자

[Python] 백준 2231번(분해합) 문제 풀이 본문

PS/Python

[Python] 백준 2231번(분해합) 문제 풀이

KwonYongHyeon 2022. 3. 27. 19:59

 

n = int(input())
a = False
for i in range(1, n):
    hihi = i + sum(list(map(int, str(i))))
    if hihi == n:
        print(i)
        a = True
        break
if a == False:
    print(0)

 

 내가 예전에 내가 왜 hihi라는 변수명을 쓰는지 올린 적이 있었던 것 같다.

 

 https://developer-next-to-you.tistory.com/70

 

[Python] 백준 2475번(검증수) 문제 풀이

numbers = list(map(int, input().split())) hihi = 0 for number in numbers: hihi += number ** 2 print(hihi % 10)  고유번호 5자리를 입력받은 후, 그 숫자들의 제곱수를 hihi 변수에 저장한다. 그 뒤 hihi..

developer-next-to-you.tistory.com

Comments