#include <iostream>
using namespace std;
const int lmax=10000;
int c1[lmax+1],c2[lmax+1]; //为节约储存空间,定义2个数组,实际为3个数组
int main()
{
int n,i,j,k;
while (cin>>n)
{
for (i=0;i<=n;i++)
{
c1[i]=0; //初始化
c2[i]=0;
}
for (i=0;i<=n;i++) c1[i]=1; //定义第一组数组c1[n]={1}为第一项
for (i=2;i<=n;i++) //i表示项数,也可利用i表达等差d
{
for (j=0;j<=n;j++) j控制c1[n]循环,j表示的总值,最大为总值n
for (k=0;k+j<=n;k+=i) //k个一跳
{
c2[j+k]+=c1[j]; //本应该为c2[j+k]+=c2[j+k]+c1[j]*c'[k];
}
for (j=0;j<=n;j++)
{
c1[j]=c2[j]; //c[2]赋值给c[1],c2清空
c2[j]=0;
}
}
cout<<c1[n]<<endl;
}
return 0;
}
11-07
11-07
11-07