#include <cstdlib>
#include <iostream>
#include <vector>
#include <deque>
using namespace std;
#if 1
class Test
{
public:
int FMath(int n)
{
if(n == 1)
return 1;
else if(n == 2)
return 1;
return FMath(n-1) + FMath(n-2);
}
};
#endif
int main(int argc, char *argv[])
{
Test t;
//cout << t.FMath(1) << endl;
#if 1
for(int i=1; i<10; ++i)
{
cout << t.FMath(i) << endl;
}
#endif
system("PAUSE");
return EXIT_SUCCESS;
}
递归模型和边界
最新推荐文章于 2021-07-19 17:14:29 发布