Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
104803 糜宗易 22兔子问题 C++ Compile Error 0 MS 0 KB 240 2025-01-11 13:16:56

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:6: error: conflicting declaration 'int b'
  int b=0;
      ^
Main.cc:6:11: note: previous declaration as 'int b [n]'
  int a[n],b[n];
           ^
Main.cc:12:4: error: incompatible types in assignment of 'int*' to 'int [n]'
   b=b+a[i];
    ^
Main.cc:14:10: error: invalid operands of types 'int [n]' and 'int' to binary 'operator*'
  cout<