8000 feat: baekjoon 1546 평균 · hellonayeon/c-cpp@dfb0fda · GitHub
[go: up one dir, main page]

Skip to content

Commit dfb0fda

Browse files
committed
feat: baekjoon 1546 평균
1 parent 09f66ad commit dfb0fda

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

BAEKJOON/Q1546.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <stdio.h>
2+
3+
int main() {
4+
int N;
5+
scanf("%d", &N);
6+
7+
float scores[N];
8+
int i, max=0;
9+
for (i=0; i<N; i++) {
10+
scanf("%f", &scores[i]);
11+
12+
if(scores[i] > max) {
13+
max = scores[i];
14+
}
15+
}
16+
17+
float sum=0.0;
18+
for (i=0; i<N; i++) {
19+
sum += scores[i]/max*100.0;
20+
}
21+
22+
printf("%f\n", sum/N);
23+
}

0 commit comments

Comments
 (0)
0