BOJ | 15596번

송치헌·2021년 6월 22일
0
post-thumbnail

Python 풀이

def solve(a): #solve함수 정의
    return sum(a) #list a의 합을 구하는 함수의 결과를 리턴

C++ 풀이

#include <vector>
long long sum(std::vector<int> &a) {
    long long ans = 0;
    for (int n : a) {
    	ans += n;
    }
    return ans;
}
profile
https://oraange.tistory.com/ 여기에도 많이 놀러와 주세요

0개의 댓글