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 Test
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. String str="agile";
  14. int x[]= {1,2,3,4,5};
  15. char y[]= new char[5];
  16. int i = 0;
  17. while (i < str.length())
  18. { y[i] = str.charAt(i);
  19. i++;}
  20. for (int p : x)
  21. { i--;
  22. System.out.print(y[i]);
  23. System.out.print(p + " ");
  24. }
  25. }
  26. }
Success #stdin #stdout 0.12s 53516KB
stdin
Standard input is empty
stdout
e1 l2 i3 g4 a5