-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCW_3.java
More file actions
27 lines (23 loc) · 704 Bytes
/
Copy pathCW_3.java
File metadata and controls
27 lines (23 loc) · 704 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
import java.util.Arrays;
import java.util.Scanner;
public class CW_3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Input
String str = scanner.nextLine();
int K = scanner.nextInt();
int num = scanner.nextInt();
// Logic
String[] splitArray = str.split(" ");
int[] arr = new int[splitArray.length];
for (int i = 0; i < splitArray.length; i++) {
arr[i] = Integer.parseInt(splitArray[i]);
}
Arrays.sort(arr);
if (arr[K - 1] >= num) {
System.out.println("True");
} else {
System.out.println("False");
}
}
}