#K34472. Decode Message
Decode Message
Decode Message
You are given a string s
that contains exactly one *
character. Your task is to decode the message by reversing the part of the string that comes after the *
character and then concatenating it to the part before the *
.
More formally, let s be divided into two parts as follows:
[ \text{before} = s[0..i-1] \quad \text{and} \quad \text{after} = s[i+1..n-1] ]
where i
is the index of the *
character. Then, output:
[ \text{result} = \text{before} + \text{reverse(after)} ]
The input is provided via standard input and the result should be printed to standard output.
inputFormat
The input consists of a single line containing the encoded string s
with exactly one *
character.
Note: The string contains no spaces.
outputFormat
Output the decoded message on a single line. The decoded message is obtained by reversing the substring that comes after the *
character and concatenating it with the substring before the *
.
hello*world
hellodlrow