Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
12551 蒋瀚辉 奇偶位互换 C++ Accepted 9 MS 728 KB 260 2021-05-21 14:15:53

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int t; string a; int main() { cin >> t; for(int i=1;i<=t;i++) { cin >> a; int len=a.size(); for(int i=0;i<len-1;i+=2) { swap(a[i],a[i+1]); } cout << a << endl; } return 0; }