-
Notifications
You must be signed in to change notification settings - Fork 2
/
1018 - Banknotes
85 lines (65 loc) · 1.25 KB
/
1018 - Banknotes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include<stdio.h>
int main()
{
int N,x;
scanf("%d",&N);
if(N>0 && N<1000000){
printf("%d\n",N);
if(N>=100) {
x=N/100;
printf("%d nota(s) de R$ 100,00\n",x);
}
else {
printf("0 nota(s) de R$ 100,00\n");
}
N=N%100;
if(N>=50 && N<100) {
x=N/50;
printf("%d nota(s) de R$ 50,00\n",x);
}
else {
printf("0 nota(s) de R$ 50,00\n");
}
N=N%50;
if(N>=20 && N<50) {
x=N/20;
printf("%d nota(s) de R$ 20,00\n",x);
}
else {
printf("0 nota(s) de R$ 20,00\n");
}
N=N%20;
if(N>=10 && N<20) {
x=N/10;
printf("%d nota(s) de R$ 10,00\n",x);
}
else {
printf("0 nota(s) de R$ 10,00\n");
}
N=N%10;
if(N>=5 && N<10) {
x=N/5;
printf("%d nota(s) de R$ 5,00\n",x);
}
else {
printf("0 nota(s) de R$ 5,00\n");
}
N=N%5;
if(N>=2 && N<5) {
x=N/2;
printf("%d nota(s) de R$ 2,00\n",x);
}
else {
printf("0 nota(s) de R$ 2,00\n");
}
N=N%2;
if(N>=1 && N<2) {
x=N/1;
printf("%d nota(s) de R$ 1,00\n",x);
}
else {
printf("0 nota(s) de R$ 1,00\n");
}
}
return 0;
}