-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day 7.java
42 lines (40 loc) · 1002 Bytes
/
Day 7.java
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
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
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);
String s,p="",p1="";
int i,l,n,j;
char c;
n=sc.nextInt();
for(j=1;j<=n;j++)
{
s=sc.next();
l=s.length();
char c1[]=new char[l];
for(i=0;i<l;i++)
{
c=s.charAt(i);
c1[i]=c;
}
for(i=0;i<l;i++)
{
if(i%2==0)
{
p=p+c1[i];
}
else
{
p1=p1+c1[i];
}
}
System.out.println(p+ " " +p1);
p="";
p1="";
}
}
}