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. if(number >= 10)
  11. {
  12. cout << ",";
  13. }
  14. cout << digit;
  15. }
  16.  
  17. int main()
  18. {
  19. explode(12345678);
  20. }
  21.  
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
1,2,3,4,5,6,7,8