Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88248 小徐老师 数组中元素交换 C++ Wrong Answer 1 MS 272 KB 352 2024-08-19 09:33:53

Tests(1/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int a,c; cin>>a; int b[a]; for(int i = 0; i <= a-1; i++) cin>>b[i]; for(int i = 0; i < a/2; i+=2) { c = b[i]; b[i] = b[i+1]; b[i+1] = c; } for(int i = 0; i <= a-1; i++) cout<<b[i]<<' '; return 0; }


Run Info:

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