| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 135929 | 林嘉乐 | 前缀和数组 | C++ | Compile Error | 0 MS | 0 KB | 402 | 2025-11-08 17:30:42 |
#include<bits/stdc++.h> using namespace std; int main(){ int *a=new int[101]; int *b=new int[101]; memset(a,0,sizeof(int)101); memset(b,0,sizeof(int)101); int n; cin>>n; for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n;i++){ for(int j=0;j<=i;j++){ b[i]+=a[j]; } } for(int i=0;i<n;i++){ cout<<b[i]<<' '; } cout<<endl; delete []a; delete []b; return 0; }
Main.cc: In function 'int main()':
Main.cc:6:24: error: expected ')' before numeric constant
memset(a,0,sizeof(int)101);
^
Main.cc:7:24: error: expected ')' before numeric constant
memset(b,0,sizeof(int)101);
^