C++:: 프로그래머스 < 내적 >

jahlee·2023년 6월 24일
0

프로그래머스_Lv.1

목록 보기
39/75
post-thumbnail

단순히 주어진 설명대로 하면 되는 아주 간단한 문제이다.

#include <string>
#include <vector>

using namespace std;

int solution(vector<int> a, vector<int> b) {
    int answer = 0;
    for (int i=0; i<a.size(); i++) answer += a[i] * b[i];
    return answer;
}

0개의 댓글