#278. 字符串提取中间两字符
字符串提取中间两字符
Extract Middle Characters
Background
Congcong is learning string processing and encountered an interesting small problem.
Problem Description
Given a string of even length, return a string made of the middle two characters. For example, the string "string" yields "ri". The string length will be at least .
Input Format
Input is given from standard input in the following format.
An even-length string .
Output Format
Output is printed to standard output in the following format.
The string consisting of the middle two characters of string .
Sample
string
"ri"
code
"od"
Practice
"ct"
Sample Explanation
For the first sample, the string "string" has a length of . The middle two characters are 'r' and 'i' at indices and (assuming -indexed), which combine to "ri". For the second sample, the string "code" has a length of . The middle two characters are 'o' and 'd' at indices and (assuming -indexed), which combine to "od".
Constraints
Time limit: second, Memory limit: KiB for each test case.