#abc293a. A - Swap Odd and Even
A - Swap Odd and Even
Score : points
问题描述
你将得到一个由小写英文字母组成的长度为偶数的字符串 。设 表示字符串 的长度, 表示字符串 中的第 个字符。
按照以下顺序对每个 执行以下操作,并打印最终的 :
- 将 和 交换位置。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string of even length consisting of lowercase English letters. Let be the length of , and be the -th character of .
Perform the following operation for each in this order, and print the final .
- Swap and .
Constraints
- is a string of even length consisting of lowercase English letters.
- The length of is at most .
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
abcdef
Sample Output 1
badcfe
Initially, abcdef
.
Performing the operation for swaps and , making bacdef
.
Performing the operation for swaps and , making badcef
.
Performing the operation for swaps and , making badcfe
.
Thus, badcfe
should be printed.
Sample Input 2
aaaa
Sample Output 2
aaaa
Sample Input 3
atcoderbeginnercontest
Sample Output 3
taocedbrgeniencrnoetts
update @ 2024/3/10 12:11:58