문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV13zo1KAAACFAYh


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
 
    for(int t_case=0; t_case<10; t_case++) {
        int score[101= {0}, temp, max=0, max_students=0;
 
        cin >> temp;
        
        for(int i=0; i<1000; i++) {
            cin >> temp;
            score[temp]++;
        }
 
        for(int i=0; i<101; i++) {
            if(score[i] >= max_students) {
                max = i;
                max_students = score[i];
            }
        }
 
        cout << "#" << t_case+1 << " " << max << "\n";
    }
 
    return 0;
}
cs

+ Recent posts