Sum of products of two arrays (dotproduct)

前端 未结 6 1349
难免孤独
难免孤独 2021-02-04 05:49

First off, I know my title can be formulated better, but my math classes are so far gone I can\'t remember the correct words anymore..

I need to do something like this (

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 06:20

    int result = 0;
    for(int i = 0; i < digits1.length; i++)
    {
        result += digits1[i] * digits2[i];
    }
    

提交回复
热议问题