Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
112259 | 李朋秦 | 数组中元素交换 | C++ | Wrong Answer | 1 MS | 276 KB | 310 | 2025-03-09 09:38:08 |
#include<bits/stdc++.h> using namespace std; int main() { int a[100],b,c=0; cin>>b; for(int i=0;i<b;i++){ cin>>a[i]; }for(int j=0;j<(b-1);j++){ c=a[j]; a[j]=a[j+1]; a[j+1]=c; } for(int d=0;d<b;d++){ cout<<a[d]; if(d!=b-1){ cout<<" "; } } cout<<endl; return 0; }
------Input------
5 81 43 69 80 80
------Answer-----
43 81 80 69 80
------Your output-----
43 69 80 80 81