-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7.lets_review.java
28 lines (25 loc) · 934 Bytes
/
7.lets_review.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
//https://www.hackerrank.com/challenges/30-review-loop/problem
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 scan= new Scanner(System.in);
int x=scan.nextInt();
scan.nextLine();
for(int i=0;i<x;i++)
{
String s1,s2;
s1 = s2 =" ";
String s=scan.next();
char[] charArray=s.toCharArray();
for(int j=0;j<charArray.length;i+=2){
s1 += charArray[i];
}
for(int j=1;j<charArray.length;j+=2){
s2 +=charArray[j];
}
System.out.println(s1+" "+s2);
}
}
}