-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbijele.java
58 lines (38 loc) · 872 Bytes
/
bijele.java
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
import java.util.Scanner;
public class bijele {
public static void main(String[] args) {
/**One king
One queen
Two rooks
Two bishops
Two knights
Eight pawns*/
Scanner scan = new Scanner(System.in);
int[] current = new int[6];
int[] best = new int[6];
int[] ans = new int[6];
best[0] = 1;
best[1] = 1;
best[2] = 2;
best[3] = 2;
best[4] = 2;
best[5] = 8;
for(int i=0; i<6; i++){
current[i] = scan.nextInt();
}
for(int i=0; i<6; i++){
if(current[i] == best[i]) ans[i] = 0;
}
for(int i=0; i<6; i++){
if(current[i] < best[i]){
ans[i] = best[i] - current[i];
}else{
ans[i] = -1 * (current[i] - best[i]);
}
}
for(int i=0; i<6; i++){
System.out.print(ans[i] + " ");
}
scan.close();
}
}