| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 153559 | 赵奕杰 | 数组中元素交换 | C++ | Wrong Answer | 1 MS | 272 KB | 251 | 2026-05-22 20:08:23 |
#include<bits/stdc++.h> using namespace std; int a[105]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i+=2){ swap(a[i],a[i++]); } for(int i=1;i<=n;i++){ cout<<a[i]<<" "; } return 0; }
------Input------
1 49
------Answer-----
49
------Your output-----
0