← 返回 ibm 的题目列表Reverse Last Two Characters with a Space
类型:online_judge
Given a string s (assume its length is at least 2), output the last two characters in reversed order with a single space in between.
Example: for "bat", the last two characters are a and t; reversing them and inserting a space yields "t a".
Input format: one line containing string s.
Output format: one line: lastChar + " " + secondLastChar.
Constraints:
2 <= len(s) <= 1e5
The string may contain any visible characters; treat characters as-is.
Example:
Input: bat
Output: t a
Example
Input
bat
Output
t a