Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
108143 陈铎文 数组中元素交换 C++ Wrong Answer 0 MS 280 KB 326 2025-01-19 14:51:34

Tests(1/10):


Code:

#include<iostream> using namespace std; int main(){ int n,a[101]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n-1;i+=2){ if(i+1==n){ break; } swap(a[i],a[i+1]); } for(int i=1;i<=n;i++){ cout<<a[i]; } return 0; }


Run Info:

------Input------
5 81 43 69 80 80
------Answer-----
43 81 80 69 80
------Your output-----
4381806980