728x90


15596번: 정수 N개의 합
C++17, Java 8, Python 3, C11, PyPy3, C99, C++98, C++11, C++14, Go, C99 (Clang), C++98 (Clang), C++11 (Clang), C++14 (Clang), C11 (Clang), C++17 (Clang)
www.acmicpc.net
#include <vector>
using namespace std;
long long sum(vector<int> &a) {
long long result = 0;
for (int i = 0; i < a.size(); i++) {
result += a[i];
}
return result;
}
728x90
'Algorithm > 백준' 카테고리의 다른 글
[C++] 백준 11719번: 그대로 출력하기 2 (0) | 2022.02.14 |
---|---|
[C++] 백준 11718번: 그대로 출력하기 (0) | 2022.02.14 |
[C++] 백준 2441번: 별 찍기-4 (0) | 2022.02.13 |
[C++] 백준 2440번: 별 찍기-3 (0) | 2022.02.12 |
[C++] 백준 1152번: 단어의 개수 (0) | 2022.02.12 |
댓글