简单dp ,水题
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int n;
int d[] = {1,5,10,25,50};
long long dp[30010];
int main(){
memset(dp,0,sizeof(dp));
dp[0] = 1;
for(int i=0;i<5;i++){
for(int j=0;j+d[i]<=30000;j++){
dp[j+d[i]] += dp[j];
}
}
while(cin >> n){
if(dp[n]==1) printf("There is only 1 way to produce %d cents change.\n",n);
else printf("There are %lld ways to produce %d cents change.\n",dp[n],n);
}
return 0;
}