Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76044 朱子相 求点积 C++ Compile Error 0 MS 0 KB 245 2024-06-01 15:25:01

Tests(0/0):


Code:

#include<iostream> #include<iomanip> using namespace std; int main() { int n; cin>>n; int a[1001],b[1001] for(int i=1;i<=n;i++){ cin>>b[i]; } int s = 0; for(int i=1;i<=n;i++){ s += a[i]*b[i]; } cout<<s; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:2: error: expected initializer before 'for'
  for(int i=1;i<=n;i++){
  ^
Main.cc:8:14: error: 'i' was not declared in this scope
  for(int i=1;i<=n;i++){
              ^
Main.cc:13:14: error: 'b' was not declared in this scope
    s += a[i]*b[i];
              ^