-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay6.java
More file actions
32 lines (27 loc) · 863 Bytes
/
Copy pathDay6.java
File metadata and controls
32 lines (27 loc) · 863 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
31
32
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
int count = sc.nextInt();
String s = "";
String s1 = "";
String s2 = "";
sc.nextLine();
for(int i=0;i<count;i++) {
s = sc.nextLine();
String[] characters = s.split("");
for (int j = 0; j < characters.length; j++) {
if (j % 2 == 0) {
s1 += characters[j];
} else {
s2 += characters[j];
}
}
System.out.println(s1 + ' ' + s2);
s1 = ""; s2 = "";
}
sc.close();
}
}