-
Notifications
You must be signed in to change notification settings - Fork 0
/
1021.cpp
43 lines (37 loc) · 935 Bytes
/
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
#include<iostream>
using namespace std;
int main(){
double N;
int q, a, b;
while(cin >> N){
q = N;
N = 100*N;
b = N;
cout << "NOTAS:\n";
cout << q/100 << " nota(s) de R$ 100.00\n";
a = (q%100);
cout << a/50 << " nota(s) de R$ 50.00\n";
a = (a%50);
cout << a/20 << " nota(s) de R$ 20.00\n";
a = (a%20);
cout << a/10 << " nota(s) de R$ 10.00\n";
a = (a%10);
cout << a/5 << " nota(s) de R$ 5.00\n";
a = (a%5);
cout << a/2 << " nota(s) de R$ 2.00\n";
a = (a%2);
cout << "MOEDAS:\n";
cout << a/1 << " moeda(s) de R$ 1.00\n";
b = b%100;
cout << b/50 << " moeda(s) de R$ 0.50\n";
b = b%50;
cout << b/25 << " moeda(s) de R$ 0.25\n";
b = b%25;
cout << b/10 << " moeda(s) de R$ 0.10\n";
b = b%10;
cout << b/5 << " moeda(s) de R$ 0.05\n";
b = b%5;
cout << b/1 << " moeda(s) de R$ 0.01\n";
}
return 0;
}