Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int digitos(long long x){
- int cont = 0;
- while(x>0){
- x/=10;
- cont++;
- }
- return cont;
- }
- int main(){
- int n;
- long long k = 1;
- bool go = true;
- while(cin>>n){
- while(go){
- if(k%n==0){
- cout<<digitos(k)<<"\n";
- go = false;;
- }
- k = ((k*10)+1)%n;
- }
- go = true;
- k = 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement