Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
135937 罗迎甲 前缀和数组 C++ Compile Error 0 MS 0 KB 468 2025-11-08 17:35:23

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int *a=new int[101]; int *a=new int[101]; memest(a,0,sizeof(int)*101); memest(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 t=0;t<n;t++) b[i]=b[t]; } for(int i=0;i<n;i++){ cout<<b[i]<<' '; } cout<<endl; delete []a; delete []b; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:10: error: redeclaration of 'int* a'
     int *a=new int[101];
          ^
Main.cc:5:10: note: 'int* a' previously declared here
     int *a=new int[101];
          ^
Main.cc:7:31: error: 'memest' was not declared in this scope
     memest(a,0,sizeof(int)*101);
                               ^
Main.cc:8:12: error: 'b' was not declared in this scope
     memest(b,0,sizeof(int)*101);
            ^
Main.cc:22:14: error: type '' argument given to 'delete', expected pointer
     delete []b;
              ^