| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 124132 | 晏莞煜 | 数组中元素交换 | C++ | Wrong Answer | 0 MS | 272 KB | 243 | 2025-07-11 09:52:47 |
#include<iostream> using namespace std; int main(){ int n; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n-1;i+=2){ int y; y=a[i]; a[i]=a[i+1]; a[i+1]=y; cout<<a[i]<<" "<<a[i+1]<<" "; } return 0; }
------Input------
1 49
------Answer-----
49
------Your output-----