-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSWEA1970.java
More file actions
56 lines (32 loc) · 956 Bytes
/
SWEA1970.java
File metadata and controls
56 lines (32 loc) · 956 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.study.code.solved;
import java.util.Scanner;
public class SWEA1970 {
private static Scanner sc;
public static void main(String[] args) {
sc = new Scanner(System.in);
int tcN = sc.nextInt();
for (int tc = 1; tc <= tcN; tc++) {
int a, b, c, d, e, f, g, h = 0;
int money = sc.nextInt();
a = money / 50000;
money -= a * 50000;
b = money / 10000;
money -= b * 10000;
c = money / 5000;
money -= c * 5000;
d = money / 1000;
money -= d * 1000;
e = money / 500;
money -= e * 500;
f = money / 100;
money -= f * 100;
g = money / 50;
money -= g * 50;
h = money / 10;
money -= h * 10;
System.out.println("#" + tc);
System.out.println(a + " " + b + " " + c + " " + d + " " + e + " " + f + " " + g + " " + h);
}
sc.close();
}
}