Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
99142 | 朱安然 | 数组中元素交换 | C++ | Wrong Answer | 0 MS | 272 KB | 272 | 2024-11-24 14:10:16 |
#include<bits/stdc++.h> using namespace std; int main(){ int b; cin>>b;//3 int a[b],t; for(int i=0;i<b;i++){ cin>>a[i]; } for(int i=0;i<b;i=i+2){ t=a[i]; a[i]=a[i+1]; a[i+1]=t; } for(int i=0;i<b;i++){ cout<<a[i]<<" "; } return 0; }
------Input------
1 49
------Answer-----
49
------Your output-----
32764