#include<cstdio> #include<cstring> #include<iostream> using namespace std; int coin[12]={2000,1000,400,200,100,40,20,10,4,2,1}; int main() { int i,j,k,l,m,c; float n; while(scanf("%f",&n)==1&&n!=0.00) { m=(n * 100 + .5); m=m/5; long long nway[7000]; for(i=0;i<7000;i++)nway[i]=0; nway[0]=1; for(i=0;i<11;i++) { c=coin[i]; for(j=c;j<=m;j++) { nway[j]+=nway[j-c]; } } printf("%6.2lf", n); cout.width(17); cout << nway[m] << endl; } return 0; }
No comments:
Post a Comment