forked from ndb796/python-for-coding-test
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1.java
26 lines (20 loc) ยท 750 Bytes
/
1.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
import java.util.*;
public class Main {
public static String str;
public static int summary = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
str = sc.next();
// ์ผ์ชฝ ๋ถ๋ถ์ ์๋ฆฟ์์ ํฉ ๋ํ๊ธฐ
for (int i = 0; i < str.length() / 2; i++) {
summary += str.charAt(i) - '0';
}
// ์ค๋ฅธ์ชฝ ๋ถ๋ถ์ ์๋ฆฟ์์ ํฉ ๋นผ๊ธฐ
for (int i = str.length() / 2; i < str.length(); i++) {
summary -= str.charAt(i) - '0';
}
// ์ผ์ชฝ ๋ถ๋ถ๊ณผ ์ค๋ฅธ์ชฝ ๋ถ๋ถ์ ์๋ฆฟ์ ํฉ์ด ๋์ผํ์ง ๊ฒ์ฌ
if (summary == 0) System.out.println("LUCKY");
else System.out.println("READY");
}
}