#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll table[10000],coin[6];
int main()
{
ll i,j,k,l,m,n;
while(cin>>n)
{
memset(table,0,sizeof(table));
coin[1]=1;
coin[2]=5;
coin[3]=10;
coin[4]=25;
coin[5]=50;
table[0]=1;
for(i=1;i<=5;i++)
{
for(j=coin[i];j<n+1;j++)
{
table[j]=table[j]+table[j-coin[i]];
}
}
cout<<table[n]<<endl;
}
return 0;
}
using namespace std;
typedef long long ll;
ll table[10000],coin[6];
int main()
{
ll i,j,k,l,m,n;
while(cin>>n)
{
memset(table,0,sizeof(table));
coin[1]=1;
coin[2]=5;
coin[3]=10;
coin[4]=25;
coin[5]=50;
table[0]=1;
for(i=1;i<=5;i++)
{
for(j=coin[i];j<n+1;j++)
{
table[j]=table[j]+table[j-coin[i]];
}
}
cout<<table[n]<<endl;
}
return 0;
}
No comments:
Post a Comment