문제 : https://www.acmicpc.net/problem/10039
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int s = 0;
int sum = 0;
for(int i = 0; i < 5 ; i++) {
s= scan.nextInt();
if(s>100 || s <0 || s%5 != 0 ) {
s = 0;
} else if(s < 40) {
s = 40;
}
sum = s +sum;
}
System.out.println(sum/5);
}
}
'알고리즘 > 심심풀이 문제풀기' 카테고리의 다른 글
[심심풀이 백준문제풀기] 2908번 상수 (0) | 2018.02.24 |
---|---|
[심심풀이 백준문제풀기]10809번 알파벳 찾기 (0) | 2018.02.24 |
[심심풀이 백준문제풀기]8958번 OX문제 (0) | 2017.12.26 |
[심심풀이 백준문제풀기] 2577번 숫자의 개수 (0) | 2017.12.26 |
[심심풀이 백준문제풀기] 1152번 단어의 개수 (0) | 2017.12.22 |