BackJoon Algorithm 평균점수 10039 (Java)
BackJoon Algorithm - Java
문제
풀이
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Back_10039 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int sum = 0;
for (int i = 0; i < 5; i++) {
int num = Integer.parseInt(br.readLine());
if(num < 40){
num = 40;
}
sum += num;
}
System.out.println(sum/5);
}
}
댓글남기기