-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathDelta.java
More file actions
23 lines (21 loc) · 857 Bytes
/
Copy pathDelta.java
File metadata and controls
23 lines (21 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package delta;
import java.io.*;
import java.util.*;
public class Delta {
public static void main(String[] args) throws IOException {
ArrayList<Integer> data = new ArrayList<>();
String result;
String str;
FileReader file = new FileReader("input.txt");
Scanner sc = new Scanner(file);
str = sc.nextLine();
StringTokenizer st = new StringTokenizer(str, " ");
while (st.hasMoreTokens()){
data.add(Integer.valueOf(st.nextToken()));
}
result = (data.get(0) < data.get(1) + data.get(2) && data.get(1) < data.get(0) + data.get(2) && data.get(2) < data.get(0) + data.get(1)) ? "YES" : "NO"; // Проверка на вырожденность
FileWriter fileOut = new FileWriter("output.txt");
fileOut.write(result);
fileOut.close();
}
}