Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- Stack
- implement
- Matrix
- Number Theory
- 코테
- 구현
- bit manipulation
- Math
- simulation
- database
- Tree
- Class
- two pointers
- hash table
- Counting
- 자바
- sorting
- array
- Binary Tree
- Binary Search
- java
- geometry
- dynamic programming
- SQL
- 코딩테스트
- 파이썬
- greedy
- Data Structure
- string
- Method
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 배열의 평균값 본문
1. Input
1) 정수 배열 numbers
2. Output
2) numbers의 원소의 평균값
3. Constraint
1) 0 <= numbers의 원소 <= 1,000
2) 1 <= numbers의 길이 <= 100
3) 정답의 소수 부분은 .0 또는 .5
4. Example
Input: numbers={1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -> Output: 5.5
5. Code
1) 첫 코드(2022/10/17)
double sum = 0;
for(int i=0 ; i<numbers.length ; i++)
sum += numbers[i];
return sum / numbers.length;
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 옷가게 할인 받기 (0) | 2022.10.20 |
---|---|
[프로그래머스/Lv.0] 최빈값 구하기 (0) | 2022.10.19 |
[프로그래머스/Lv.0] 피자 나눠 먹기 (3) (0) | 2022.10.19 |
[프로그래머스/Lv.0] 피자 나눠 먹기 (2) (0) | 2022.10.19 |
[프로그래머스/Lv.0] 피자 나눠 먹기 (1) (0) | 2022.10.19 |