Ms. Whitby's Classroom logo Ms. Whitby's Classroom

Reverse a word

String indices start at 0. The last character has index length() - 1.

Your task

Print the first argument in reverse order, followed by a newline. If there are no arguments, print an empty line. Inputs contain only ASCII letters and are at most 100 characters long.

Example argument

WAGNER

Expected output

RENGAW

Try building the result one character at a time, or printing characters in a backward loop and adding the newline at the end.