백준 1546번(Java)

박은지·2025년 2월 4일

백준

목록 보기
8/89
post-thumbnail

import java.io.*;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		
		double[] score = Arrays.stream(br.readLine().split(" "))
						  .mapToDouble(Double::parseDouble).toArray();
		double sum = 0;
		
		Arrays.sort(score);
		
		for(int i=0; i<score.length; i++) {
			sum += ((score[i]/score[score.length - 1]) * 100);
		}
		
		System.out.println(sum / score.length);
	}
}
profile
백엔드 개발자가 되고싶은 eunzi😊

0개의 댓글