X Tutup
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"); } }
X Tutup