SHARE
TWEET

Untitled

a guest Nov 7th, 2018 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using namespace std;
  2. int main()
  3. {  
  4.    int n,k=0,i;
  5.    cin>>n;
  6.    
  7.    for(i = 0; i < n ; ++i)
  8.    {
  9.     k = k*10 +1;
  10.     k %= n;
  11.     if(k == 0) break;
  12.    }
  13.    
  14.    if(i != n)
  15.    {
  16.    for(int j = 0 ; j < i+1 ; ++j)
  17.    cout<<1;
  18.    }
  19.    else cout<<"NO";
  20.    
  21.    cout<<endl;
  22.  
  23.    return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top