Reverse Text
InterviewTime limit1sMemory limit128 MB
Read each test case line and print its characters in reverse order.
- Level
Easy1 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
In most languages, text is written from left to right. However, some languages are read and written from right to left. As a first step toward a program that automatically translates between a left-to-right language and a right-to-left language in both directions, write a program that reverses the direction of a given text.
Input
The first line contains an integer , the number of test cases. Each of the following lines contains a single line of text consisting of at most 70 characters. The newline character at the end of each line is not counted as part of the line.
Output
For each test case, print a line containing the characters of the input line in reverse order.