Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
88251 | 张曦 | 数组中元素交换 | C++ | Wrong Answer | 1 MS | 268 KB | 408 | 2024-08-19 09:37:44 |
#include <bits/stdc++.h> using namespace std; int main() { int a,c; cin>>a; int b[a]; for(int i = 0;i < a-1;i++) cin>>b[i]; for(int i = 0;i < a/2;i+=2) { c = b[2 * i]; b[2 * i] = b[2 * i+1]; b[2 * i+1] = c; } for(int i = 0;i < a-1;i++) cout<<b[i]<<' '; return 0; }
------Input------
1 49
------Answer-----
49
------Your output-----