| ||||||||||
| 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 | |||||||||
帮我看看哪里错了啊~~~老是WA~~~ 想不通#include <iostream>
#include <algorithm>
using namespace std;
int test[100000];
int main(void)
{
int N,i,j,k,tmp;
int label[92];
char ch;
label[65]=label[66]=label[67]=2;
label[68]=label[69]=label[70]=3;
label[71]=label[72]=label[73]=4;
label[74]=label[75]=label[76]=5;
label[77]=label[78]=label[79]=6;
label[80]=label[82]=label[83]=7;
label[84]=label[85]=label[86]=8;
label[87]=label[88]=label[89]=9;
for(i=48;i<=57;++i)
label[i]=i-48;
scanf("%d",&N);
for(j=k=0;j<N;++j)
{
i=0;
tmp=1000000;
while(true)
{
scanf("%c",&ch);
if((ch>=65&&ch<=90)||(ch>=48&&ch<=57))
{
test[k]+=label[ch]*tmp;
tmp/=10;
if(++i==7)
{
++k;
break;
}
}
}
}
sort(test,test+k);
for(ch=0,i=j=1,k=test[0];i<N;++i)
{
if(test[i]==k)++j;
else
{
if(j>1)
{
printf("%03d-%04d %d\n",k/10000,k%10000,j);
j=1;
ch=1;
}
k=test[i];
}
}
if(0==ch)printf("No duplicates.\n");
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator