Submission #168993


Source Code Expand

Copy
#include <iostream>
#include <string>

using namespace std;

int main(){
    int N;
    char name[50][50];
    int position[50] = {0};
    int buf = 0, loc = 0;


    cin >> N;
    for(int i=0; i < N; i++){
            cin >> name[i];
        for(int j=0; j < i; j++){
            if(strcmp(name[i], name[j]) == 0){
                position[j] += 1;
            }
        }
    }


    for(int i=0; i < N; i++){
        if(position[i] > buf){
            buf = position[i];
            loc = i;
        }
    }



    cout << name[loc] << endl;

    return 0;
}

Submission Info

Submission Time
Task B - 投票
User hlr0shl
Language C++ (G++ 4.6.4)
Score 0
Code Size 596 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:17:39: error: ‘strcmp’ was not declared in this scope