-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day6_ Let's Review
46 lines (35 loc) · 948 Bytes
/
Day6_ Let's Review
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
46
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
List<String> S=new ArrayList<>();
String S1;
int T,N;
Scanner sc=new Scanner(System.in);
T=sc.nextInt();
for(int i=0;i<T;i++)
{ S.add(sc.next());
}
for(int i=0;i<T;i++)
{
S1=S.get(i);
N=S1.length();
for(int j=0;j<N;j++)
{
if(j%2==0)
{
System.out.print(S1.charAt(j));
}
}
System.out.print(" ");
for(int j=0;j<N;j++)
{
if(j%2!=0)
{
System.out.print(S1.charAt(j));
}
}
System.out.print("\n");
}
}
}