빠르게 짰다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
int result = 0; | |
Scanner sc = new Scanner(System.in); | |
int[] a = new int[5]; | |
for(int i=0; i<5; i++) { | |
a[i] = sc.nextInt(); | |
if(a[i]<40) { | |
a[i]=40; | |
} | |
result = result+a[i]; | |
} | |
int b = result/5; | |
System.out.println(b); | |
} | |
} |
'백준 알고리즘 > JAVA' 카테고리의 다른 글
[JAVA 자바] 백준 10809번 알파벳 찾기 (0) | 2018.07.09 |
---|---|
[JAVA 자바] 백준 11654번 아스키 코드 (0) | 2018.07.09 |
[JAVA 자바] 백준 2920번 음계 (0) | 2018.07.09 |
[JAVA 자바] 백준 8958번 OX퀴즈 (0) | 2018.07.09 |
[JAVA 자바] 백준 2577번 숫자의 개수 (0) | 2018.07.08 |