diff --git a/src/week1/BOJ4375/BOJ4375_V1.cpp b/src/week1/BOJ4375/BOJ4375_V1.cpp new file mode 100644 index 0000000..a282972 --- /dev/null +++ b/src/week1/BOJ4375/BOJ4375_V1.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +typedef long long ll; +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + + int n; + + + while (scanf("%d", &n) != EOF) { + int cnt = 1; + ll ret = 1; + while(true) { + if (ret % n == 0) { + cout << cnt << "\n"; + break; + } else { + ret = (ret * 10) + 1; + ret %= n; + cnt++; + } + } + } + + + + + return 0; +} \ No newline at end of file