您的位置:首页 > 其它

poj 1028 Ignatius and the Princess III 等于价值为M的有多少种情况

2013-04-11 15:11 323 查看
#include<cstdio>
#include<iostream>
#include<stdlib.h>
#include<ctype.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
#include<iomanip>
#include<set>
#include<string>
#include<iterator>
using namespace std;
int dp[200];
int main(){
int n;
while(cin>>n){
memset(dp,0,sizeof(dp));
dp[0]=1;
for(int i=1;i<=n;i++)
for(int j=i;j<=n;j++)
dp[j]+=dp[j-i];
cout<<dp
<<endl;

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: