Untitled
unknown
plain_text
a year ago
1.1 kB
9
Indexable
#include <stdio.h>
int main() {
float tk;
int b;
scanf("%f", &tk);
int a = (int)(tk * 100 + 0.5);
printf("NOTAS:\n");
b = a / 10000;
printf("%d nota(s) de R$ 100.00\n", b);
a = a % 10000;
b = a / 5000;
printf("%d nota(s) de R$ 50.00\n", b);
a = a % 5000;
b = a / 2000;
printf("%d nota(s) de R$ 20.00\n", b);
a = a % 2000;
b = a / 1000;
printf("%d nota(s) de R$ 10.00\n", b);
a = a % 1000;
b = a / 500;
printf("%d nota(s) de R$ 5.00\n", b);
a = a % 500;
b = a / 200;
printf("%d nota(s) de R$ 2.00\n", b);
a = a % 200;
printf("MOEDAS:\n");
b = a / 100;
printf("%d moeda(s) de R$ 1.00\n", b);
a = a % 100;
b = a / 50;
printf("%d moeda(s) de R$ 0.50\n", b);
a = a % 50;
b = a / 25;
printf("%d moeda(s) de R$ 0.25\n", b);
a = a % 25;
b = a / 10;
printf("%d moeda(s) de R$ 0.10\n", b);
a = a % 10;
b = a / 5;
printf("%d moeda(s) de R$ 0.05\n", b);
a = a % 5;
b = a;
printf("%d moeda(s) de R$ 0.01\n", b);
return 0;
}
Editor is loading...
Leave a Comment