#include<cstdio> #include<iostream> #define ull unsigned long long int usingnamespace std;
int n, k;
inlinevoiddfs(ull ans, int n, int weishu){ if (k == 0) return; if (weishu == 20) return; if (ans%n == 0) { cout << ans << '\n'; k = 0; return; } dfs (ans*10, n, weishu+1); dfs (ans*10+1, n, weishu+1); }
intmain(){ while (scanf ("%d", &n)&& n != 0) { k = 1; dfs (1, n, 1); } return0; }
this is a easy topic
but I can not make it unless I can read the answer
To tell the truth, I was very terrible
Although the topic is easy but I don't know how to solve it
I will also try my best to welcome the NOIP2020.
PS:
1.we need the 'weishu == 20'
because the ull can held '19' so we much let the ull can search
all