-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.java
31 lines (28 loc) · 925 Bytes
/
Main.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
package L1_062;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
/**
* @author zmj
* @create 2019/5/7
*/
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
for (int i = 0; i < n; i++) {
String s = br.readLine();
int a = 0, b = 0;
for (int j = 0; j < 6; j++) {
if (j < 3) a += Integer.parseInt(String.valueOf(s.charAt(j)));
else if (j < 6) b += Integer.parseInt(String.valueOf(s.charAt(j)));
}
if (a == b) {
System.out.println("You are lucky!");
} else {
System.out.println("Wish you good luck.");
}
}
}
}