Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159336 谭鑫哲 求点积 C++ Accepted 1 MS 272 KB 494 2026-08-28 10:19:08

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,z=0; cin>>n; int c,a[n]={},b[n]={}; for(c=0;c<n;c++){ cin>>a[c]; } for(c=0;c<n;c++){ cin>>b[c]; } for(n-=1;n>=0;n--){ z+=a[n]*b[n]; } cout<<z; return 0; }