Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
120973 | 石茂诤 | 前缀和数组 | C++ | Accepted | 1 MS | 268 KB | 235 | 2025-06-02 17:18:42 |
#include<bits/stdc++.h> using namespace std; int a[10000],n; int s; int main(){ cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } int *q=a; for(int i = 0;i<n;i++){ s+=*q; cout<<s<<" "; *q++; } return 0; }