fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void explode(int number)
  5. {
  6. int ctrack = 0;
  7. if (number <= 0) return;
  8. int digit = number % 10;
  9. explode(number/10);
  10. cout << digit;
  11.  
  12.  
  13. if(number >= 10) {
  14. cout << ",";
  15. }
  16. }
  17.  
  18. int main()
  19. {
  20. explode(12345678);
  21. }
  22.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
12,3,4,5,6,7,8,