标签:style blog class code c java
#include<iostream> #include<map> using namespace std; int helper(const int a[],const int n) { map<int,int> m; for(int i = 0;i<n;i++) m[a[i]]++; map<int,int>::iterator comp = m.begin(); for( map<int,int>::iterator it = comp;it != m.end();it++) if(comp->second < it->second) comp = it; return comp->second; } int main() { int a[] = {1,2,3,4,4,4,5,5,5,5,6}; cout<<helper(a,sizeof(a)/sizeof(a[0])); }
标签:style blog class code c java
原文地址:http://www.cnblogs.com/berkeleysong/p/3735497.html