标签:
#include <iostream>#include <map>#include <string>using namespace std;int main(){int n;cin>>n;while(n--){map<char, int> count;map<char, int>::iterator iter;int m;string temp;cin>>m>>temp;for(int i=0; i<temp.length(); i++){iter=count.find(temp[i]);if(iter==count.end() ){count[temp[i]]=1;}else{count[temp[i]]=iter->second+1;}}}return 0;}
标签:
原文地址:http://www.cnblogs.com/sober-reflection/p/5f455503a10c48ff4d2873de261e1c56.html