-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBJAlgo_2920.java
More file actions
29 lines (24 loc) · 880 Bytes
/
Copy pathBJAlgo_2920.java
File metadata and controls
29 lines (24 loc) · 880 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
28
29
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class BJAlgo_2920 {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] tmp = br.readLine().split(" ");
boolean ascending = true;
boolean descending = true;
for(int i = 1; i < tmp.length; i++) {
if(Integer.parseInt(tmp[i]) > Integer.parseInt(tmp[i - 1])) {
descending = false;
} else if(Integer.parseInt(tmp[i]) < Integer.parseInt(tmp[i - 1])) {
ascending = false;
}
}
if (ascending) {
System.out.println("ascending");
} else if (descending) {
System.out.println("descending");
} else {
System.out.println("mixed");
}
}
}