728x90
반응형
SMALL
import java.util.*;
public class day1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(); // 과목의 갯수 N 입력 (1000보다 작거나 같)
int scores [] = new int [N]; // 과목의 점수들을 담을 인트형 배
for(int i = 0 ; i < N ; i++) {
scores [i] = sc.nextInt();
}
long sum = 0; // 초기화
long max = 1;
for(int i = 0 ; i < N ; i++) {
if (max < scores[i]) {
max = scores[i];
}
sum = sum + scores[i];
}
sum = (long) (sum * 100.0 / N / max);
System.out.println(sum);
}
}
728x90
반응형
LIST
'알고리즘 > 알고리즘 코딩테스트_자바편(책)' 카테고리의 다른 글
| 백준_11660번_구간합구하기2 (1) | 2024.02.14 |
|---|---|
| 백준_11659번_구간합구하기 (0) | 2024.01.31 |
| 백준_11720번_숫자의합구하기 (1) | 2024.01.29 |
| 3. 자료구조 (0) | 2024.01.29 |
| 1. 어떤 알고리즘으로 풀어야 할까 ? (0) | 2024.01.29 |