-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSymmetricOrder.java
More file actions
30 lines (27 loc) · 858 Bytes
/
SymmetricOrder.java
File metadata and controls
30 lines (27 loc) · 858 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
30
//Symmetric Order
import java.util.*;
public class SymmetricOrder{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int num = input.nextInt();
int set = 1;
while (num != 0){
System.out.println("SET " + set);
int control = num;
String[] names = new String[num];
for (int i = 0; i < num / 2; i++){
names[i] = input.next();
names[control - 1] = input.next();
control--;
}
if (num % 2 != 0) {
names[(num / 2)]= input.next();
}
for (int i = 0; i < names.length; i++) {
System.out.println(names[i]);
}
num = input.nextInt();
set++;
}
}
}