-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay 6
33 lines (25 loc) · 792 Bytes
/
Day 6
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
33
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int N = in.nextInt();
in.nextLine();
for (int i = 0; i < N; i++) {
String string = in.nextLine();
char[] charArray = string.toCharArray();
for (int j = 0; j < charArray.length; j++) {
if (j % 2 == 0) {
System.out.print(charArray[j]);
}
}
System.out.print(" ");
for (int j = 0; j < charArray.length; j++) {
if (j % 2 != 0) {
System.out.print(charArray[j]);
}
}
System.out.println();
}
in.close();
}
}