Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main() {
- double a;
- scanf("%lf",&a);
- int x,b,c,d,e,f,g,h,i,j,k,l,m;
- x=a*100;
- b=x/10000;
- x=x%10000;
- c=x/5000;
- x=x%5000;
- d=x/2000;
- x=x%2000;
- e=x/1000;
- x=x%1000;
- f=x/500;
- x=x%500;
- g=x/200;
- x=x%200;
- h=x/100;
- x=x%100;
- i=x/50;
- x=x%50;
- j=x/25;
- x=x%25;
- k=x/10;
- x=x%10;
- l=x/5;
- x=x%5;
- m=x;
- printf("NOTAS:\n");
- printf("%d nota(s) de R$ 100.00\n",b);
- printf("%d nota(s) de R$ 50.00\n",c);
- printf("%d nota(s) de R$ 20.00\n",d);
- printf("%d nota(s) de R$ 10.00\n",e);
- printf("%d nota(s) de R$ 5.00\n",f);
- printf("%d nota(s) de R$ 2.00\n",g);
- printf("MOEDAS:\n");
- printf("%d moeda(s) de R$ 1.00\n",h);
- printf("%d moeda(s) de R$ 0.50\n",i);
- printf("%d moeda(s) de R$ 0.25\n",j);
- printf("%d moeda(s) de R$ 0.10\n",k);
- printf("%d moeda(s) de R$ 0.05\n",l);
- printf("%d moeda(s) de R$ 0.01\n",m);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement