原题:http://acm.hdu.edu.cn/showproblem.php?pid=1028
#include<iostream>
using namespace std;
const int maxn = 250;
int arr[maxn], tmp[maxn];
int n;
int main(){
while(cin>>n){
for(int i = 0;i<=n;i++){
arr[i] = 1;
tmp[i] = 0;
}
for(int i = 2;i<=n;i++){
for(int j = 0;j<=n;j++){
for(int k = 0;k+j<=n;k+=i)
tmp[j+k] += arr[j];
}
for(int j = 0;j<=n;j++){
arr[j] = tmp[j];
tmp[j] = 0;
}
}
cout<<arr[n]<<endl;
}
return 0;
}