fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void countdown(int N) {
  5.  
  6. cout << N << endl;
  7. if (N > 0) {
  8. countdown(N - 1);
  9. }
  10.  
  11. }
  12.  
  13. int main() {
  14.  
  15. countdown(5);
  16. return 0;
  17.  
  18. }
Success #stdin #stdout 0.01s 5460KB
stdin
Standard input is empty
stdout
5
4
3
2
1
0