빠르게 짰다.


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);
}
}
view raw test.java hosted with ❤ by GitHub

+ Recent posts