| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160092 | 王顺煜 | 数组中元素交换 | C++ | Accepted | 1 MS | 268 KB | 313 | 2026-09-12 14:48:42 |
#include<bits/stdc++.h> using namespace std; int main(){ long long n,a[101]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n-1;i+=2){ long long temp=a[i]; a[i]=a[i+1]; a[i+1]=temp; } for(int i=1;i<n;i++){ cout<<a[i]<<" "; } cout<<a[n]; return 0; }