#include<iostream>
using namespace std;
//递归调用函数1
//F(x)=2*F(x-1)+x*x,F(0)=0;
int F(int x)
{
if(x==0)
return 0;
else
return 2*F(x-1)+x*x;
}
//递归调用函数2
//输出一个整数。而由于某些原因系统只能输出一个单词每次。
//显示72694,先显示7269再显示4,欲显示7269,先显示726,再显示9.
void printf_N(int N)
{
if(N>=10)
printf_N(N/10);
cout<<(N%10)<<' ';
}
int main()
{
//cout<<F(3)<<endl;
printf_N(72694);
cout<<endl;
system("pause");
return 1;
}
递归_简单入门1
最新推荐文章于 2022-11-12 17:02:03 发布