import element.*; public class ReverseString { public static String reverse(String s) // pre: s is non-null // post: the result is the reverse of the input { String result = ""; int i; for (i = 0; i < s.length(); i++) { result = s.charAt(i) + result; } return result; } public static void main(String args[]) { int i; for (i = 0; i < args.length; i++) { System.out.println(reverse(args[i])); } } }