[백준] 4673번 : 셀프 넘버 - Python(파이썬)

강재원·2022년 10월 19일
0

[코딩테스트] Python

목록 보기
129/200



https://www.acmicpc.net/problem/4673

def d(n):
    num=n
    while n>0:
        num+=n%10
        n=int(n/10)
    return num

i=1
while i<=10000:
    count=0
    j=1
    while j<=10000:
        if i==d(j):
            count=0
            break
        else:
            count=1
            j+=1
    if count==1:
        print(i)
    i+=1
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글