保证AC
2025-09-05 20:28:05
发布于:四川
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, b, c;
cin >> n >> b >> c;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
b--;
c--;
int temp = a[b];
a[b] = a[c];
a[c] = temp;
for (int i = 0; i < n; i++) {
cout << a[i] << " ";
}
}
这里空空如也
有帮助,赞一个