Swap Odd and Even

AtCoder
IDabc293_a
Time2000ms
Memory256MB
Difficulty
You are given a string $S$ of even length consisting of lowercase English letters. Let $|S|$ be the length of $S$, and $S_i$ be the $i$\-th character of $S$. Perform the following operation for each $i = 1, 2, \ldots, \frac{|S|}{2}$ in this order, and print the final $S$. * Swap $S_{2i-1}$ and $S_{2i}$. ## Constraints * $S$ is a string of even length consisting of lowercase English letters. * The length of $S$ is at most $100$. ## Input The input is given from Standard Input in the following format: $S$ [samples]
Samples
Input #1
abcdef
Output #1
badcfe

Initially, $S =$ `abcdef`.  
Performing the operation for $i = 1$ swaps $S_1$ and $S_2$, making $S =$ `bacdef`.  
Performing the operation for $i = 2$ swaps $S_3$ and $S_4$, making $S =$ `badcef`.  
Performing the operation for $i = 3$ swaps $S_5$ and $S_6$, making $S =$ `badcfe`.  
Thus, `badcfe` should be printed.
Input #2
aaaa
Output #2
aaaa
Input #3
atcoderbeginnercontest
Output #3
taocedbrgeniencrnoetts
API Response (JSON)
{
  "problem": {
    "name": "Swap Odd and Even",
    "description": {
      "content": "You are given a string $S$ of even length consisting of lowercase English letters. Let $|S|$ be the length of $S$, and $S_i$ be the $i$\\-th character of $S$. Perform the following operation for each $",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc293_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a string $S$ of even length consisting of lowercase English letters. Let $|S|$ be the length of $S$, and $S_i$ be the $i$\\-th character of $S$.\nPerform the following operation for each $...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments