Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136816 李折曦 数组中元素交换 C++ Wrong Answer 1 MS 276 KB 393 2025-11-15 15:20:37

Tests(0/10):


Code:

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


Run Info:

------Input------
1 49
------Answer-----
49
------Your output-----
0