Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105340 | 王煜鑫 | 求点积 | C++ | Compile Error | 0 MS | 0 KB | 305 | 2025-01-13 11:58:53 |
#include <bits/stdc++.h> using namespace std; int a[1098]; int b[1098]; int main() { int n,sum=0,abc=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; sum=a[i]; } for(int i=1;j<=n;i++){ cin>>b[i]; } for(int j=1;j<=n;j++){ sum+=a[j]*b[j]; } cout<<sum; }
Main.cc: In function 'int main()': Main.cc:12:15: error: 'j' was not declared in this scope for(int i=1;j<=n;i++){ ^ Main.cc:6:15: warning: unused variable 'abc' [-Wunused-variable] int n,sum=0,abc=0; ^