#C12779. Reverse a String

    ID: 42243 Type: Default 1000ms 256MiB

Reverse a String

Reverse a String

Given a string, reverse it without using any built-in reverse functions. The reversed version of a string is a sequence with the characters in the opposite order. For example, if the input is hello, the output should be olleh.

Your task is to write a program that reads a string from standard input and outputs its reversed version. The solution must handle edge cases, such as an empty string.

inputFormat

A single line containing the string to be reversed. The string may be empty or include spaces.

outputFormat

A single line containing the reversed string.## sample

hello
olleh