cswork / OA打开练习工作台

OracleOA #8

Last and Second-Last

估计简单可在线判题

考点(AI 标注)字符串

Return a new string made of the last character of the string, one ordinary space, and the second-to-last character.

输入格式

The input is one JSON string whose length, counted in Unicode code points, is 2..100 (the original length bound). The source does not restrict the character set; this site allows all Unicode scalar values, including whitespace, NUL, and non-BMP characters, but no lone surrogate code points. Characters are preserved through JSON encoding, and the input is ≤1230 bytes.

输出格式

Output one canonical ASCII JSON string with no extra whitespace; a trailing newline is optional. Printable ASCII other than double quotes and backslashes is output as is (including /); double quotes and backslashes are each escaped; backspace, form feed, newline, carriage return, and tab use \b, \f, \n, \r, \t respectively; other control characters, DEL, and non-ASCII characters use lowercase four-digit \uXXXX, and non-BMP characters use lowercase UTF-16 surrogate pairs. The surrounding double quotes must be kept; this is equivalent to Python json.dumps(value,ensure_ascii=True).

样例 1

输入:

"APPLE"

输出:

"E L"

样例 2

输入:

"bat"

输出:

"t a"

样例 3

输入:

"\u0000\ud83d\ude00"

输出:

"\ud83d\ude00 \u0000"

样例说明

The outputs of the three public examples are, in order: "E L"; "t a"; "\ud83d\ude00 \u0000". They were verified by independent enumeration or direct simulation.