一个简单的递归调用,注意输出::
#include<iostream>
void countdown(int n);
int main (){
countdown(4);
return 0;
}
void countdown(int n)
{
using namespace std;
cout<< "Countdown down ...."<<n<<endl;
if(n>0)
countdown(n-1);
cout<< n << " ::: kaboom !\n";
}