#include <string> #include <vector> using namespace std; double solution(vector<int> arr) { double answer = 0; for(int i = 0; i < arr.size(); i++) { answer += arr[i]; } answer /= arr.size(); return answer; } | cs |
'Programmers > Level 1' 카테고리의 다른 글
[프로그래머스 1] 핸드폰 번호 가리기 (C/C++) (0) | 2019.10.19 |
---|---|
[프로그래머스 1] 하샤드 수 (C/C++) (0) | 2019.10.19 |
[프로그래머스 1] 콜라츠 추측 (C/C++) (2) | 2019.10.19 |
[프로그래머스 1] 최대공약수와 최소공배수 (C/C++) (0) | 2019.10.19 |
[프로그래머스 1] 짝수와 홀수 (C/C++) (0) | 2019.10.19 |