STL_set

#include <iostream>
#include <set>
#include <string>
#include <cstdio>

using namespace std;

int main()
{
    int N, max, count;
    char ss[11];
    string s;

    multiset<string> S;
    scanf("%d", &N);
    while(N--)
    {
        gets(ss);
        s = ss;
        S.insert(s);
        count = S.count(s);
        if(count > max)
            max = count;
    }
    printf("%d
", max);

    return 0;
}
原文地址:https://www.cnblogs.com/wwjyt/p/3182859.html