← Back to List

1681번: 줄 세우기 ↗

Solutions

C++14
354 B | 354 chars
#include <iostream>
using namespace std;
int N,K,cnt,x=0;
int main() {
    cin >> N >> K;
    while(cnt < N) {
        x++;
        int z = x;
        bool chk = true;
        while(z>0){
            if(z%10 == K) {
                chk = false;
                break;
            }
            z/=10;
        }
        if(chk) cnt++;
    }
    cout<<x;
}