본문 바로가기

코딩테스트

프로그래머스_1단계_내적_C++

 

문제풀이:

#include <string>
#include <vector>

using namespace std;

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