μκ³ λ¦¬μ¦ νμ΄/baekjoon
[cμΈμ΄]λ°±μ€ 10039λ² νκ· μ μ νμ΄
mmin.h
2020. 3. 30. 20:50
μλ νμΈμ Moderalchemist Hμ λλ€.
μ€λμ μ€μ΅ 1μ μλ 10039λ² λ¬Έμ λ₯Ό νμ΄λ³΄λλ‘ νκ² μ΅λλ€.
https://www.acmicpc.net/problem/10039
νμ΄λ μλμ κ°μ΄ ν μ μκ² μ΅λλ€.
λ¬Έμ μμ μ΄λ €μ΄ λ¬Έλ²μ λ±ν μκ³ 40μ μ΄νλ μ μ κ΄κ³μμ΄ λ¬΄μ‘°κ±΄ 40μ μ΄ λλ€λ κ²λ§ μ£Όμν΄μ£Όλ©΄ λκ² μ΅λλ€.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include<stdio.h>
#define num 5
int main(void) {
int list[num];
int sum = 0;
for (int i = 0; i < num; i++) {
scanf("%d", &list[i]);
if (list[i] < 40){
list[i] = 40;
}
sum = sum + list[i];
}
printf("%d", sum/num);
return 0;
}
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |