题解(c++)
2025-03-30 17:41:13
发布于:黑龙江
3阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n + 1] = {0};
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] = a[i] + i;
cout << a[i] << " ";
}
return 0;
}
运用一维数组的原则就行
22 | 22 |
---|---|
22 | 22 |
![]() |
这里空空如也
有帮助,赞一个