Written by
java-style
on
on
[JAVA] 프로그래머스 없는숫자 더하기, 평균 구하기
[JAVA] 프로그래머스 없는숫자 더하기, 평균 구하기
728x90
알고리즘
JAVA 프로그래머스 없는숫자 더하기, 평균 구하기
없는숫자 더하기
1. 문제
https://programmers.co.kr/learn/courses/30/lessons/86051
2. 풀이
1부터 9까지 합인 45에서 numbers안에 숫자들을 하나씩 빼준다
class Solution { public int solution(int[] numbers) { int answer = 45; for (int i=0; i
평균 구하기
1. 문제
https://programmers.co.kr/learn/courses/30/lessons/12944
2. 풀이
arr를 for문으로 하나씩 더해주고 arr의 개수로 나눠준다.
double(실수)로 표시하기!
class Solution { public double solution(int[] arr) { double answer = 0; int sum = 0; for (int i=0; i
728x90
from http://yuricoding.tistory.com/46 by ccl(A) rewrite - 2021-11-09 09:28:17