- 229 名前:デフォルトの名無しさん mailto:sage [2008/10/28(火) 23:25:51 ]
-
int main(){ string str; map<string,int> test; int maxval=0; string maxkey='\0'; test["hoge"]++; test["hoge"]++; test["huga"]++; map<string, int>::iterator itr = test.begin(); map<string, int>::iterator itrEnd = test.end(); while(itr != itrEnd){ if(itr->second >maxval){ maxval = itr->second; maxkey = itr->first; } itr++; } cout << "maxkey:" << maxkey << endl; } コンパイルはできるんですが、とまります・・・
|

|