fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. // your code goes here
  11. Scanner sc=new Scanner(System.in);
  12. int a=sc.nextInt();
  13. String input[]=new String[a];
  14. for(int i=0;i<a;i++){
  15. input[i]=sc.next();
  16. }
  17. String rev=new StringBuffer(input[0]).reverse().toString()+"ly";
  18. String rev1=new StringBuffer(input[1]).reverse().toString()+"ly";
  19. String rev2=new StringBuffer(input[2]).reverse().toString()+"ly";
  20.  
  21. System.out.println(rev +" "+ rev1+" "+rev2);
  22. }
  23. }
  24.  
  25.  
  26.  
Success #stdin #stdout 0.06s 2184192KB
stdin
3
Anu
KArpagam
College
stdout
unAly magaprAKly egelloCly