forked from ndb796/python-for-coding-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.java
More file actions
17 lines (13 loc) · 338 Bytes
/
1.java
File metadata and controls
17 lines (13 loc) · 338 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public class Main {
public static void main(String[] args) {
int n = 1260;
int cnt = 0;
int[] coinTypes = {500, 100, 50, 10};
for (int i = 0; i < 4; i++) {
int coin = coinTypes[i];
cnt += n / coin;
n %= coin;
}
System.out.println(cnt);
}
}