[프로그래머스 문제풀이61]평균 구하기 자바

이ᄏᄋ·2021년 9월 30일
0
class Solution {
    public double solution(int[] arr) {
        double answer = 0;
        double sum=0;
        for(int num:arr){
            sum+=num;
        }
        answer=sum/arr.length;
        return answer;
    }
}
profile
미쳤다.

0개의 댓글