Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
48837 冯诚阳 奇偶位互换 C++ Accepted 4 MS 272 KB 380 2023-06-15 16:32:17

Tests(1/1):


Code:

#include<iostream> #include<cstring> using namespace std; int main() { int C; cin >> C; for(int i = 0; i < C; i++) { char a[60]; cin >> a; int n = strlen(a); for(int j = 0; j < n; j++) { if(j % 2 == 0) cout << a[j + 1]; else cout << a[j - 1]; } cout << endl; } return 0; }