-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay 6
45 lines (32 loc) · 1.11 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
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 scanner =new Scanner (System.in);
String odd="";
String even="";
int N =scanner.nextInt();
scanner.nextLine();
for (int i=1;i<=N;i++){
String s=scanner.nextLine();
char[] charArray = s.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();
}
}
}