map的应用
#include<iostream>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
int main(){
int n;
cin>>n;
map<char, char> m;
map<string,int> out;
m['A']=m['B']=m['C']='2';
m['D']=m['E']=m['F']='3';
m['G']=m['H']=m['I']='4';
m['J']=m['K']=m['L']='5';
m['M']=m['N']=m['O']='6';
m['P']=m['R']=m['S']='7';
m['T']=m['U']=m['V']='8';
m['W']=m['X']=m['Y']='9';
while(n--){
char s[100];
cin>>s;
string str;
int k=0;
for(int i=0;i<s[i]!='\0';i++){
if(s[i]=='-') continue;
k++;
if(s[i]>='0'&&s[i]<='9') str+=s[i];
else str+=m[s[i]];
if(k==3) str+='-';
}
out[str]++;
}
int flag=0;
for(map<string,int>::iterator it=out.begin();it!=out.end();it++){
if(it->second>1){
flag=1;
cout<<it->first<<" "<<it->second<<endl;
}
}
if(!flag) cout<<"No duplicates. ";
return 0;
}