fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. Scanner sc = new Scanner(System.in);
  14. String st = sc.nextLine();
  15. String str1 = "",str2="";
  16. int n = st.length();
  17. int m = st.length() / 2;
  18. for(int i=0;i<m;i++)
  19. {
  20. str1 = str1 + st.charAt(i);
  21. }
  22. for(int i=m+1;i<n;i++)
  23. {
  24. str2 = str2 + st.charAt(i);
  25. }
  26. System.out.println(str1 + "" + str2);
  27.  
  28. //String st = new String();
  29.  
  30. }
  31. }
Success #stdin #stdout 0.14s 38012KB
stdin
sumi musi
stdout
sumimusi