Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits\stdc++.h>
- using namespace std;
- int main()
- {
- int a, b, n;
- scanf("%d %d %d", &a, &b, &n);
- int i, j, op, f = 0;
- for(i = 0; i < 10; i++)
- {
- op = (a*10) + i;
- if(op % b == 0)
- {
- printf("%d", op);
- for(j = 0; j < n - 1; j++) printf("0");
- f = 1;
- printf("\n");
- break;
- }
- }
- if(f == 0) printf("-1\n");
- }
Add Comment
Please, Sign In to add comment