#35. 字符串首尾添加字符
字符串首尾添加字符
Add Character to Front and Back of String
Background
This is a simple problem about string manipulation.
Problem Description
Given a string, take its last character and return a new string with the last character added at the front and back. For example, "cat" yields "tcatt". The original string will be of length or more.
Input Format
Input is given from standard input in the following format.
A string.
Output Format
Output is printed to standard output in the following format.
The modified string.
Sample
cat
"tcatt"
Hello
"oHelloo"
a
"aaa"
Sample Explanation
For the first sample, the last character of the string "cat" is 't'. Adding it to the front and back of "cat" results in "tcatt". For the second sample, the last character of the string "Hello" is 'o'. Adding it to the front and back of "Hello" results in "oHelloo". For the third sample, the last character of the string "a" is 'a'. Adding it to the front and back of "a" results in "aaa".
Constraints
Time limit: second, Memory limit: KiB for each test case.