반응형
/*
* Author : Jeonghun Cho
* Date : December 3, 2019
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int[] size = new int[Integer.parseInt(br.readLine())];
String[] str = br.readLine().split(" ");
double dSize = 0.0, maxSize = 0.0, sum = 0.0;
for(int i=0; i<size.length; i++) {
size[i] = Integer.parseInt(str[i]);
if(maxSize < size[i]) {
maxSize = size[i];
}
}
for(int i=0; i<size.length; i++) {
sum += size[i]/maxSize*100;
}
}
}
Colored by Color Scripter
|
반응형
'알고리즘 > 백준' 카테고리의 다른 글
[백준] 15596 정수 N개의 합 (Java) (0) | 2019.12.04 |
---|---|
[백준] 8958 OX퀴즈 (Java) (0) | 2019.12.03 |
[백준] 2577 숫자의 개수 (Java) (0) | 2019.12.03 |
[백준] 2562 최댓값 (Java) (0) | 2019.12.03 |
[백준] 10816 최소, 최대 (Java) (0) | 2019.12.03 |