#include <iostream>
#include <sstream>
using namespace std;
int f[5005];
long long temp(string A, string B)//高精A+B
{
long long a[5005], b[5005], c[5005], len = max(A.length(), B.length());
for(int i = A.length() - 1, j = 1; i >= 0; i--, j++) a[j] = A[i] - '0';
for(int i = B.length() - 1, j = 1; i >= 0; i--, j++) b[j] = B[i] - '0';
for(int i = 1; i <= len; i++)
{
c[i] += a[i] + b[i];
c[i + 1] = c[i] / 10;
c[i] %= 10;
}
if(c[len + 1]) len++;
for(int i = len; i >= 1; i--)
{
return c[i];
}
}
string tostr(long long value)//long long 转 string
{
stringstream ss;
ss << value;
string str = ss.str();
return str;
}
int main()
{
int n;
cin >> n;
f[0] = 0;
f[1] = 1;
f[2] = 2;
for(int i = 3; i <= n; i++)
{
f[i] = temp(tostr(f[i - 1]), tostr(f[i - 2]));
}
cout << f[n];
return 0;
}
20pts,求助。