POJ-1426 Find The Multiple

E - Find The Multiple (POJ - 1426)
POJ-1426 Find The Multiple

using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int N = 15+5;

int n;

void bfs() {
    queue<ll> q;
    q.push(1);
    while(!q.empty()) {
        ll t = q.front();
        q.pop();
        if(t%n==0) {
            printf("%lld\n", t);
            return ;
        }
        q.push(t*10);
        q.push(t*10+1);
    }
}

int main(void) {

    while(scanf("%d", &n)==1 && n) {
        bfs();
    }
    return 0;
}

上一篇:QT编译错误: multiple definition of `qMain(int, char**)'


下一篇:友元函数重定义 / multiple definition