题目描述
钞票和硬币
恶心至极
样例
#include <stdio.h>
int main()
{
double m;
int n,a,b,c,d,e,f,g,h,i,j,k,l;
scanf("%lf",&m);
n=m*100;
a=n/10000;
b=n%10000/5000;
c=n%10000%5000/2000;
d=n%10000%5000%2000/1000;
e=n%10000%5000%2000%1000/500;
f=n%10000%5000%2000%1000%500/200;
g=n%10000%5000%2000%1000%500%200/100;
h=n%10000%5000%2000%1000%500%200%100/50;
i=n%10000%5000%2000%1000%500%200%100%50/25;
j=n%10000%5000%2000%1000%500%200%100%50%25/10;
k=n%10000%5000%2000%1000%500%200%100%50%25%10/5;
l=n%10000%5000%2000%1000%500%200%100%50%25%10%5;
printf("NOTAS:\n");
printf("%d nota(s) de R$ 100.00\n",a);
printf("%d nota(s) de R$ 50.00\n",b);
printf("%d nota(s) de R$ 20.00\n",c);
printf("%d nota(s) de R$ 10.00\n",d);
printf("%d nota(s) de R$ 5.00\n",e);
printf("%d nota(s) de R$ 2.00\n",f);
printf("MOEDAS:\n");
printf("%d moeda(s) de R$ 1.00\n",g);
printf("%d moeda(s) de R$ 0.50\n",h);
printf("%d moeda(s) de R$ 0.25\n",i);
printf("%d moeda(s) de R$ 0.10\n",j);
printf("%d moeda(s) de R$ 0.05\n",k);
printf("%d moeda(s) de R$ 0.01\n",l);
return 0;
}