-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1021.c
94 lines (93 loc) · 1.29 KB
/
1021.c
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
#include <stdio.h>
int main (){
int i;
double y;
scanf("%lf", &y);
printf("NOTAS:\n");
i= 0.0;
while (y >= 100)
{
y = y - 100;
i = i + 1;
}
printf("%d nota(s) de R$ 100\n", i);
i = 0.0;
while (y >= 50)
{
y = y - 50;
i = i + 1;
}
printf("%d nota(s) de R$ 50\n", i);
i = 0.0;
while (y >= 20)
{
y = y - 20;
i = i + 1;
}
printf("%d nota(s) de R$ 20\n", i);
i = 0.0;
while (y >= 10)
{
y = y - 10;
i = i + 1;
}
printf("%d nota(s) de R$ 10\n", i);
i = 0.0;
while (y >= 5)
{
y = y - 5;
i = i + 1;
}
printf("%d nota(s) de R$ 5\n", i);
i = 0.0;
while (y >= 2)
{
y = y - 2;
i = i + 1;
}
printf("%d nota(s) de R$ 2\n", i);
i = 0.0;
printf("MOEDAS:\n");
while (y >= 1)
{
y = y - 1;
i = i + 1;
}
printf("%d moeda(s) de R$ 1\n", i);
i = 0.0;
while (y >= 0.50)
{
y = y - 0.50;
i = i + 1;
}
printf("%d moeda(s) de R$ 0.50\n", i);
i = 0.0;
while (y >= 0.25)
{
y = y - 0.25;
i = i + 1;
}
printf("%d moeda(s) de R$ 0.25\n", i);
i = 0.0;
while (y >= 0.10)
{
y = y - 0.10;
i = i + 1;
}
printf("%d moeda(s) de R$ 0.10\n", i);
i = 0.0;
while (y >= 0.05)
{
i = i + 1;
y = y - 0.05;
}
printf("%d moeda(s) de R$ 0.05\n", i);
i = 0.0;
while (y >= 0.01)
{
y = (y - 0.01);
i = i + 1;
}
printf("%d moeda(s) de R$ 0.01", i);
return 0;
}