| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160091 | 王艺博 | 数组中元素交换 | C++ | Accepted | 1 MS | 272 KB | 309 | 2026-09-12 14:48:01 |
#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; }