BOJ/C++ 1 IamToday 2020. 2. 6. 23:09 #include #include #include using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; while (1) { cin >> n; if (cin.eof()) break; int res = 1; int cnt = 1; while (1) { if (res % n == 0) { break; } res = res * 10 + 1; res %= n; cnt++; } cout << cnt << '\n'; } return 0; }