c++
#include <iostream>
using namespace std;
const int N = 110;
int n, a[N];
int main()
{
cin >> n;
for (int i = 1; i <= n ; i ++ )
{
cin >> a[i];
if (i % 2 == 0) swap(a[i], a[i - 1]);
}
for (int i = 1; i <= n ; i ++ )
cout << a[i] << ' ';
return 0;
}
登录后发布评论
暂无评论,来抢沙发