fork download
  1. #include <stdio.h>
  2.  
  3. int div(int m, int n) {
  4. printf("%d %d\n", m, n);
  5. if(m < n)
  6. return 0;
  7. else
  8. return 1 + div(m - n, n);
  9. }
  10.  
  11. int main(void) {
  12. int m, n;
  13. scanf("%d %d", &m, &n);
  14. printf("%d", div(m, n));
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5312KB
stdin
10 1
stdout
10 1
9 1
8 1
7 1
6 1
5 1
4 1
3 1
2 1
1 1
0 1
10