比较简单的一种办法
#include <iostream>
using namespace std;
#define MAX 1000+5</iostream>

int main()
{
int a[MAX] = {1,1};
int n;
for (int i = 2; i < 1001; i++)
{
int temp = i/2;
while (temp > 0)
{
a[i] += a[temp];
temp--;
}
a[i]++;
}
cin >> n;
cout << a[n] << endl;
return 0;
}