글
프로그래머스 C# 평균 구하기(double)
프로그래밍
2023. 1. 23. 15:11
728x90
SMALL
public class Solution {
public double solution(int[] arr) {
double answer = 0;
for(int i =0;i<arr.Length;i++)
{
answer += arr[i];
}
return answer/arr.Length;
}
}
728x90
'프로그래밍' 카테고리의 다른 글
C# 최댓값과 최솟값(Split().Select(x => ), OrderBy, ToList()) (0) | 2023.01.23 |
---|---|
프로그래머스 C# 제일 작은 수 제거하기(array.where) (0) | 2023.01.23 |
프로그래머스 C# 이상한 문자 만들기(Split, 공백 처리) (0) | 2023.01.23 |
프로그래머스 C# 핸드폰 번호 가리기(for문 안에 if문, 길이-4) (0) | 2023.01.23 |
프로그래머스 C# 짝수와 홀수(음의 정수 생각하기, 나누기) (0) | 2023.01.23 |