Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5112 柯宇希 求点积 C++ Compile Error 0 MS 0 KB 279 2024-11-02 14:39:31

Tests(0/0):


Code:

using namespace std; int main(){ int a[1010],b[1010],s=0; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ cin>>b[i]; } for(int i=0;i<n;i++){ s+=a[i]*b[i]; } cout<<s<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:4:5: error: 'cin' was not declared in this scope
     cin>>n;
     ^
Main.cc:4:10: error: 'n' was not declared in this scope
     cin>>n;
          ^
Main.cc:14:5: error: 'cout' was not declared in this scope
     cout<s<<endl;
     ^
Main.cc:14:14: error: 'endl' was not declared in this scope
     cout<<s<<endl;
              ^