#include <iostream>
#include <set>
#include <algorithm>
using namespace std;

typedef long long int INT;
set<INT> chk;

int main()
{
    for(INT i=1; i<10001; i++)
    {
        INT a=i;
        INT b=i;
        while(a/10 != 0)
        {
            b += a%10;
            a /= 10;
        }
        b += a;

        if(b<=10000)    chk.insert(b);
    }

    for(int i=1; i<10001; i++)
    {
        if(!chk.count(i))
        {
            cout << i << endl;
        }
    }

}

'코딩 일지 > baekjoon' 카테고리의 다른 글

1655 가운데를 말해요  (0) 2023.08.22
12865 - 평범한 배낭  (0) 2023.08.17
1463 - 1로 만들기  (0) 2023.02.11
2839 설탕 배달  (0) 2023.02.11
1010-다리놓기(dp를 활용한 combination 구현)  (0) 2023.01.24

+ Recent posts