| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
If there are no duplicates in the input print the line: no duplicatesIn Reply To:什么意思?还是WA,仿佛在最后一个数据WA Posted by:sunmoonstar_love at 2005-08-08 00:45:37 > #include<iostream>
> #include<map>
> #include<string>
> using namespace std;
> char tmp[200];
> string s="12345678";
> map<string,int> inch;
> map<string,int>::const_iterator iter,begin,end;
> int n,i,len;
> char key[27] = "22233344455566677778889999";
> int main()
> {
> cin>>n;
> while(n--)
> {
> cin>>tmp;
> len = 0;
> for(i=0; tmp[i]!=0; i++)
> {
> if(len==3)
> s[len++] = '-';
> if(tmp[i]<='9'&&tmp[i]>='0')
> s[len++] = tmp[i];
> else
> if(tmp[i]<'Z'&&tmp[i]>='A')
> s[len++] = key[tmp[i]-'A'];
> }
> if(inch.find(s)==inch.end())
> inch[s] = 1;
> else
> inch[s] += 1;
> }
> begin = inch.begin();
> end = inch.end();
> while(begin!=end)
> {
> if(begin->second>1)
> cout<<begin->first<<" "<<begin->second<<endl;
> begin++;
> }
> // system("pause");
> return 0;
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator