Runtime Error
[Hydro](https://hydro.ac)提供评测服务
代码
#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
int dp[1000000];
int f(int x)
{
if(dp[x] != 0)
{
return dp[x];
}
int res;
if(x == 0)
return 1;
if(x < 0)
return 0;
if(x == 1)
res = 1;
else
res = f(x-1)+f(x-2);
return dp[x] = res;
}
int main()
{
int x;
cin>>x;
while (x != 0)
{
cout<<f(x)<<endl;
cin>>x;
}
return 0;
}