| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155344 | 唐俊逸 | 数组中元素交换 | C++ | Wrong Answer | 1 MS | 268 KB | 460 | 2026-06-06 18:43:43 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[101],n; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<n;i+=2) cout<<a[i+1]<<" "<<a[i]<<" "; if(a[n]%2==1) cout<<a[n]; return 0; }
------Input------
5 81 43 69 80 80
------Answer-----
43 81 80 69 80
------Your output-----
43 81 80 69