백준 15596 c++ : 구현

magicdrill·2025년 2월 11일
0

백준 문제풀이

목록 보기
548/655

백준 15596 c++ : 구현

입력 없이 프로그래머스처럼 함수를 구현하는 문제다.

#include <vector>
long long sum(std::vector<int>& a) {
    long long ans = 0;
    int n = a.size(), i;

    for (i = 0; i < n; i++) {
        ans += a[i];
    }

    return ans;
}

0개의 댓글