알고리즘 풀이/백준

[백준][Java] 10039번 평균 점수

배게 2018. 4. 19. 03:28
728x90

40점 미만 점수들은 40점으로 간주하여 처리함

total값 계산 후 평균 출력


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int point,point_total=0;
		
		for(int i=0;i<5;i++) {
			point=sc.nextInt();
			if(point<40) point_total+=40;
			else point_total+=point;
		}
		System.out.println(point_total/5);
	}
}