Promi_38

cf 260A

Sep 27th, 2021 (edited)
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include<bits\stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a, b, n;
  8.     scanf("%d %d %d", &a, &b, &n);
  9.    
  10.     int i, j, op, f = 0;
  11.     for(i = 0; i < 10; i++)
  12.     {
  13.         op = (a*10) + i;
  14.         if(op % b == 0)
  15.         {
  16.             printf("%d", op);
  17.             for(j = 0; j < n - 1; j++) printf("0");
  18.             f = 1;
  19.             printf("\n");
  20.             break;
  21.         }
  22.     }
  23.     if(f == 0) printf("-1\n");
  24. }
Add Comment
Please, Sign In to add comment