Jam's story

[백준 15596번] 정수 N개의 합 본문

코딩테스트/백준

[백준 15596번] 정수 N개의 합

애플쩀 2022. 5. 26. 08:12

public class Test {
    long sum(int[] a) {
        long summ=0;
        for(int i:a){
            summ+=i;
        }
        
        return summ;
    }
}
public class Test {
    long sum(int[] a) {
        long summ=0;
        for(int i=0; i<a.length; i++){
            summ+=a[i];
        }
        return summ;
    }
}

'코딩테스트 > 백준' 카테고리의 다른 글

[백준] 2667번 단지번호 붙이기 - java  (0) 2022.08.05
[백준] 7562번 나이트의 이동 - java  (0) 2022.08.04
[백준] 2178번 미로탐색  (0) 2022.08.02
[2839] 설탕배달  (0) 2022.05.30
[1712번] 손익분기점  (0) 2022.05.26
Comments