2592 : 대표값

풀이

히히

코드

#include <cstdio>
int i, a, s, c[1001];
int main() {
    for (; i < 10; i++) scanf("%d", &a), s += a, c[a]++;
    for (; i < 1000; i += 10) if (c[c[0]] < c[i]) c[0] = i;
    printf("%d\n%d", s / 10, c[0]);
    return 0;
}

아무말

백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조, 문제, 문제 풀이, 풀이

wookje.kwon's profile image

wookje.kwon

2018-04-04 19:41

Read more posts by this author