fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int a, n, k;
  7. cin>>a>>n>>k;
  8. while(k--) {
  9. cout<<a%(n+1)<<" "; a=a/(n+1);
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0s 3300KB
stdin
25 4 4
stdout
0 0 1 0