// This program reads in a string and outputs it backwards.
// Barry Cornelius, 3 June 2000
import java.io. BufferedReader;
import java.io. InputStreamReader;
import java.io. IOException;
public class StringBackwards
{
   public static void main(final String[] pArgs) throws IOException
   {
      final BufferedReader tKeyboard =
                    new BufferedReader(new InputStreamReader(System.in));
      System.out.print("Type in a string: ");
      System.out.flush();
      final String tInputString = tKeyboard.readLine();
      System.out.print("And here is it backwards: ");
      final int tStringLength = tInputString.length();
      for (int tCharNumber = tStringLength - 1; 
               tCharNumber>=0; tCharNumber--) 
      {
         System.out.print(tInputString.charAt(tCharNumber));
      }
      System.out.println();
   }
}
