프로그래머스 내적
2022. 8. 4. 10:43ㆍ코딩 공부 연습
반응형
쉬운 친구를 만났다!
#include <string>
#include <vector>
using namespace std;
int solution(vector<int> a, vector<int> b) {
int answer = 1234567890;
answer = 0;
for(int i = 0; i < a.size(); i++)
{
answer += a[i]*b[i];
}
return answer;
}
c++...
def solution(a, b):
answer = 0
for i in range(0, len(a)):
answer = answer + a[i]*b[i]
return answer
파이썬..
class Solution {
public int solution(int[] a, int[] b) {
int answer = 1234567890;
answer = 0;
for (int i =0; i< a.length; i++)
{
// System.out.println(a[i]);
answer += a[i] * b[i];
}
return answer;
}
}
자바...
의미없는 짓거리들을 한것 같아 마음이 아프다
'코딩 공부 연습' 카테고리의 다른 글
프로그래머스 2016년 (0) | 2022.08.05 |
---|---|
프로그래머스 K번째수 (0) | 2022.08.04 |
프로그래머스 없는 숫자 더하기 (0) | 2022.08.04 |
프로그래머스 : 숫자 문자열과 영단어 (0) | 2022.08.03 |
프로그래머스 소수 만들기 (0) | 2022.08.03 |