#include <iostream>
using namespace std;
int main()
{
long long method[30001];
int n, m, money[11]={5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000};
method[0]=1;
for(n=1;n<30001;n++)
method[n]=0;
for(m=0;m<11;m++)
for(n=money[m];n<30001;n++)
method[n]+=method[n-money[m]];
double s;
while(cin >> s)
{
if(s==0)
break;
n=s*100.0f;
cout.width(6);
cout.precision(2);
cout << fixed << s;
cout.width(17);
cout << method[n] << endl;
}
return 0;
}
WA (line:21)
答案不正確您的答案為: 47.55 0 正確答案為: 47.55 374685162
不過本機測這個數字是對的