You are viewing a single comment's thread. Return to all comments →
For JAVA
Scanner scan=new Scanner(System.in);
int N=scan.nextInt(); scan.nextLine(); for(int i=0;i<N;i++){ String s=scan.nextLine(); for(int j=0;j<s.length();j++){ if(j%2==0){ System.out.print(s.charAt(j)); } } System.out.print(" "); for(int k=0;k<s.length();k++){ if(k%2!=0){ System.out.print(s.charAt(k)); } } System.out.println(); } scan.close();
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
For JAVA
Scanner scan=new Scanner(System.in);