有趣的任务 题解!!!
2025-03-18 21:53:31
发布于:广东
5阅读
0回复
0点赞
#include <include>
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] << " ";
}
return 0;
}
全部评论 2
头文件写错啦!!!是#include<bits/stdc++.h>!!!
2025-04-14 来自 广东
0666,"#include<include>"
2025-04-13 来自 浙江
0发错了哈,是#include<bits/stdc++.h>
2025-04-14 来自 广东
0
有帮助,赞一个