SWEA_3314) 보충학습과 평균
SWEA
# D3
3314) 보충학습과 평균 (19.10.20)
문제 링크 (SW Expert Academy)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer tk;
int test = Integer.parseInt(br.readLine());
for(int i=1; i<=test; i++) {
tk = new StringTokenizer(br.readLine());
int sum = 0;
for(int j=0; j<5; j++) {
int score = Integer.parseInt(tk.nextToken());
if(score<40) sum = sum+40;
else sum = sum+score;
}
bw.write("#" + i + " " + (sum/5) +"\n");
}
bw.flush();
bw.close();
}
}
| cs |
댓글
댓글 쓰기