| ||||||||||
| 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 | |||||||||
1002数据已经都测试了,怎么还是错#include<stdio.h>
int main()
{
static int i,j,k,n,hash[10000000]={0};
char tel[32],map[256];
map['A']=map['B']=map['C']=2;
map['D']=map['E']=map['F']=3;
map['G']=map['H']=map['I']=4;
map['J']=map['K']=map['L']=5;
map['M']=map['N']=map['O']=6;
map['P']=map['R']=map['S']=7;
map['T']=map['U']=map['V']=8;
map['W']=map['X']=map['Y']=9;
for(i='0';i<='9';i++)
map[i]=i-'0';
scanf("%d",&n);
while(n--)
{
scanf("%s",tel);
for(i=k=0,j=1000000;tel[i];i++)
{
if(tel[i]=='-')continue;
k+=map[tel[i]]*j;
j/=10;
}
hash[k]++;
}
for(i=j=0;i<10000000;i++)
if(hash[i]>1)
{
j++;
printf("%03d-%04d %d\n",i/10000,i%10000,hash[i]);
}
if(j==0)
{
puts("No duplicates.");
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator