-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
38 lines (34 loc) · 670 Bytes
/
A.cpp
File metadata and controls
38 lines (34 loc) · 670 Bytes
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
#include <stdio.h>
int main()
{
long int n;
scanf("%ld", &n);
int bill = 0;
if (n >= 100) {
int temp = n / 100;
bill += temp;
n -= (temp * 100);
}
if (n >= 20) {
int temp = n / 20;
bill += temp;
n -= (temp * 20);
}
if (n >= 10) {
int temp = n / 10;
bill += temp;
n -= (temp * 10);
}
if (n >= 5) {
int temp = n / 5;
bill += temp;
n -= (temp * 5);
}
if (n >= 1) {
int temp = n / 1;
bill += temp;
n -= (temp * 1);
}
printf("%d\n", bill);
return 0;
}