Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151224 李明秦 前缀和数组 C++ Accepted 1 MS 272 KB 260 2026-04-11 09:48:51

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,a[100],b[100],c=0; cin>>n; for(int i=0;i<n;i++)cin>>a[i]; for(int j=0;j<n;j++){ int c=0; for(int k=0;k<=j;k++)c+=a[k]; b[j]=c; cout<<b[j]<<" "; } return 0; }