-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1021.cpp
117 lines (51 loc) · 1.6 KB
/
1021.cpp
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include <iostream>
using namespace std;
int main() {
double n100, n50, n20, n10, n5, n2;
double m1, m50, m25, m10, m05, m01;
double n;
cin >> n;
int notas = n;
int moedas = (n - notas) * 100;
if((moedas * 1000) % 10 == 9){
moedas++;
}
n100 = notas/100;
notas = notas%100;
n50 = notas/50;
notas = notas%50;
n20 = notas/20;
notas = notas%20;
n10 = notas/10;
notas = notas%10;
n5 = notas/5;
notas = notas%5;
n2 = notas/2;
notas = notas%2;
m1 = notas/1;
notas = notas%1;
m50 = moedas/50;
moedas = moedas%50;
m25 = moedas/25;
moedas = moedas%25;
m10 = moedas/10;
moedas = moedas%10;
m05 = moedas/5;
moedas = moedas%5;
m01 = moedas/1;
cout << "NOTAS:" << endl;
cout << n100 << " nota(s) de R$ 100.00" << endl;
cout << n50 << " nota(s) de R$ 50.00" << endl;
cout << n20 << " nota(s) de R$ 20.00" << endl;
cout << n10 << " nota(s) de R$ 10.00" << endl;
cout << n5 << " nota(s) de R$ 5.00" << endl;
cout << n2 << " nota(s) de R$ 2.00" << endl;
cout << "MOEDAS:" << endl;
cout << m1 << " moeda(s) de R$ 1.00" << endl;
cout << m50 << " moeda(s) de R$ 0.50" << endl;
cout << m25 << " moeda(s) de R$ 0.25" << endl;
cout << m10 << " moeda(s) de R$ 0.10" << endl;
cout << m05 << " moeda(s) de R$ 0.05" << endl;
cout << m01 << " moeda(s) de R$ 0.01" << endl;
return 0;
}