정수N개의 합(15596)
함수를 구현해보자
long sum(int[] a);public class Test {
long sum(int[] a){
long ans = 0;
for (int i = 0; i < a.length; i++) {
ans += a[i];
}
return ans;
}
}Last updated
함수를 구현해보자
long sum(int[] a);public class Test {
long sum(int[] a){
long ans = 0;
for (int i = 0; i < a.length; i++) {
ans += a[i];
}
return ans;
}
}Last updated