Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <stdlib.h>
- int main () {
- int ced100 , ced50 , ced20 , ced10 , ced5 , ced2 , moe1 , moe50 , moe25 , moe10 , moe5 , moe01;
- double N;
- scanf("%lf" , &N );
- ced100 = N / 100.0;
- N = N - ( ced100 * 100.0 );
- ced50 = N / 50.0;
- N = N - ( ced50 * 50.0 );
- ced20 = N / 20.0;
- N = N - ( ced20 * 20.0 );
- ced10 = N / 10.0;
- N = N - ( ced10 * 10.0 );
- ced5 = N / 5.0;
- N = N - ( ced5 * 5.0 );
- ced2 = N / 2.0;
- N = N - ( ced2 * 2.0 );
- moe1 = N / 1.0;
- N = N - ( moe1 * 1.0 );
- moe50 = N / 0.50;
- N = N - ( moe50 * 0.50 );
- moe25 = N / 0.25;
- N = N - ( moe25 * 0.25 );
- moe10 = N / 0.10;
- N = N - ( moe10 * 0.10 );
- moe5 = N / 0.05;
- N = N - ( moe5 * 0.05 );
- moe01 = N / 0.01;
- printf("NOTAS:\n");
- printf("%d nota(s) de R$ 100,00\n" , ced100);
- printf("%d nota(s) de R$ 50,00\n" , ced50);
- printf("%d nota(s) de R$ 20,00\n" , ced20);
- printf("%d nota(s) de R$ 10,00\n" , ced10);
- printf("%d nota(s) de R$ 5,00\n" , ced5);
- printf("%d nota(s) de R$ 2,00\n" , ced2);
- printf("MOEDAS:\n");
- printf("%d moeda(s) de R$ 1,00\n" , moe1);
- printf("%d moeda(s) de R$ 0,50\n" , moe50);
- printf("%d moeda(s) de R$ 0,25\n" , moe25);
- printf("%d moeda(s) de R$ 0,10\n" , moe10);
- printf("%d moeda(s) de R$ 0,05\n" , moe5);
- printf("%d moeda(s) de R$ 0,01\n" , moe01);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement