https://vjudge.net/problem/UVA-674
题意:
计算兑换零钱的方法共有几种。
思路:
完全背包基础题。
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std; int d[];
int a[] = { , , , , }; int main()
{
//freopen("D:\\txt.txt", "r", stdin);
int s;
while (cin >> s)
{
memset(d, , sizeof(d));
d[] = ;
for (int i = ; i < ; i++)
{
for (int j = a[i]; j <= s; j++)
d[j] += d[j - a[i]];
}
cout << d[s] << endl;
}
return ;
}