提交时间:2024-01-21 09:34:05
运行 ID: 37473
#include<bits/stdc++.h> using namespace std; int main(){ int a [10000] ,s [10000] = { 0 }; int n ; cin >> n; for (int i = 1; i <= n; i++){ cin >> a[i]; s[i] = s[i-1] + a[i]; } for (int i = 1; i <= n; i++){ cout << s[i] <<" " ; } return 0; }