fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. long long int n;
  6. long long int t = 1;
  7. int c = 1;
  8.  
  9. scanf("%lld", &n);
  10.  
  11. for(long long int i = 10; t%n!=0; i*=10)
  12. {
  13. t = t + i;
  14. c++;
  15. if(t<0){return 0;}
  16. }
  17.  
  18. printf("%d\n", c);
  19. }
Success #stdin #stdout 0.01s 5284KB
stdin
9901
stdout
12