Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- { int N1, N2;
- scanf ("%d.%d", &N1, &N2);
- // Com notas
- printf("NOTAS:\n");
- printf("%i nota(s) de R$ 100.00\n", N1/100 );
- printf("%i nota(s) de R$ 50.00\n", (N1%100)/50);
- printf("%i nota(s) de R$ 20.00\n", (N1%100)%50/20);
- printf("%i nota(s) de R$ 10.00\n", (N1%100)%50%20/10);
- printf("%i nota(s) de R$ 5.00\n",(N1%100)%50%20%10/5);
- printf("%i nota(s) de R$ 2.00\n", (N1%100)%50%20%10%5/2);
- //Com moedas
- printf("MOEDAS:\n");
- printf("%i moeda(s) de R$ 1.00\n", (N1%100)%50%20%10%5%2/1);
- printf("%i moeda(s) de R$ 0.50\n", N2/50);
- printf("%i moeda(s) de R$ 0.25\n", (N2%50)/25);
- printf("%i moeda(s) de R$ 0.10\n", (N2%50)%25/10);
- printf("%i moeda(s) de R$ 0.05\n", (N2%50)%25%10/5);
- printf("%i moeda(s) de R$ 0.01\n", (N2%50)%25%10%5/1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement