递归,无限迷茫中……

#include <iostream>
void countdown (int n);

int main()
{
	countdown(4);
	return 0;
}

void countdown(int n)
{
	using namespace std;
	cout<<"Counting down ... "<<n<<"\t(n at "<<&n<<")"<<endl;
	if (n > 0)
		countdown(n-1);
	cout<<n<<": Kaboom!\t\t"<<"(n at "<<&n<<")"<<endl;
}

迷茫啊迷茫。。呃

您可能还喜欢...

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

扫码去手机上看