Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
124144 陈华仁星 数组中元素交换 C++ Wrong Answer 1 MS 204 KB 313 2025-07-11 10:01:17

Tests(2/10):


Code:

#include <cstdio> #include <algorithm> using namespace std; const int MAX=1e6; int a[MAX]; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); } for(int i=1;i<n;i+=2) { swap(a[i],a[i+1]); printf("%d %d ",a[i],a[i+1]); } printf("%d",a[n]); return 0; }


Run Info:

------Input------
8 88 69 97 66 59 86 16 16
------Answer-----
69 88 66 97 86 59 16 16
------Your output-----
69 88 66 97 86 59 16 16 16