#K68202. Reverse a String without Built-In Methods
Reverse a String without Built-In Methods
Reverse a String without Built-In Methods
You are given a non-empty string. Your task is to output its reverse without using any built-in reverse methods or slicing shortcuts.
You should implement the reversal using an iterative approach. For example:
- If the input is
hello
, then the output should beolleh
. - If the input is
Python
, then the output should benohtyP
.
inputFormat
The input consists of a single line containing a non-empty string.
outputFormat
Output the reversed string.## sample
hello
olleh