题目描述
小数无法取余,应该改为整数
样例
#include<stdio.h>
int main()
{
double n;
int a,b,c,d,e,f,g,h,i,j,k,l,N;
scanf("%lf",&n);
N=n*100;
printf("NOTAS:\n");
a=N/10000;
printf("%d nota(s) de R$ 100.00\n",a);
N=N%10000;
b=N/5000;
printf("%d nota(s) de R$ 50.00\n",b);
N=N%5000;
c=N/2000;
printf("%d nota(s) de R$ 20.00\n",c);
N=N%2000;
d=N/1000;
printf("%d nota(s) de R$ 10.00\n",d);
N=N%1000;
e=N/500;
printf("%d nota(s) de R$ 5.00\n",e);
N=N%500;
f=N/200;
printf("%d nota(s) de R$ 2.00\n",f);
printf("MOEDAS:\n");
N=N%200;
g=N/100;
printf("%d moeda(s) de R$ 1.00\n",g);
N=N%100;
h=N/50;
printf("%d moeda(s) de R$ 0.50\n",h);
N=N%50;
i=N/25;
printf("%d moeda(s) de R$ 0.25\n",i);
N=N%25;
j=N/10;
printf("%d moeda(s) de R$ 0.10\n",j);
N=N%10;
k=N/5;
printf("%d moeda(s) de R$ 0.05\n",k);
N=N%5;
l=N%5;
printf("%d moeda(s) de R$ 0.01\n",l);
return 0;
}