#include <iostream>
#include <map>
#include <cstring>
using namespace std;
int main()
{
char szNumMap[] = "22233344455566670778889990";
map<string,int> mResultMap;
string strInputTemp;
string strResult;
int nCaseCount = 0;
cin >> nCaseCount;
while(nCaseCount --)
{
cin >> strInputTemp;
strResult.clear();
for (string::size_type i = 0; i < strInputTemp.size(); ++i)
{
if (strInputTemp[i] == '-') continue;
if (isdigit(strInputTemp[i])) strResult += strInputTemp[i];
else strResult += szNumMap[strInputTemp[i] - 'A'];
}
strResult.insert(3, 1, '-');
mResultMap[strResult] ++;
}
bool bRepeat = false;
for (map<string,int>::const_iterator it = mResultMap.begin(); it != mResultMap.end(); ++it)
{
if (it->second > 1)
{
cout << it->first << " " << it->second << endl;
bRepeat = true;
}
}
if (!bRepeat) cout << "No duplicates." << endl;
return 0;
}
typedef struct
{
int identy;
char str[9];
int icount;
}Phone;
#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 100000
int cmp(const void *a, const void *b)
{
int *x = (int *)a;
int *y = (int *)b;
return (*x) - (*y);
}
int main()
{
int cnt = 0; //存放电话号码个数
int iter = 0;
int Noduplicates = 0; //有无重复号码的标志,为0则表示无重复
int Sum = 0;
int icount = 0;
char ch; // 接收键盘输入字符
int *PHONE = (int *)malloc(sizeof(int) * (MAXSIZE + 10));
scanf("%d",&cnt);
getchar();
//获取所有电话号码,转换为整型数据
for(iter = 0; iter < cnt; iter++)
{
Sum = 0;
ch = getchar();
while(ch != '\n')
{
if(ch >= '0' && ch <= '9')
{
Sum = Sum * 10 + ch - '0' ;
}
else if(ch >= 'A' && ch <= 'P')
{
Sum = Sum * 10 + (ch - 65) / 3 + 2 ;
}
else if(ch >= 'R' && ch <= 'Y')
{
Sum = Sum * 10 + (ch - 66) / 3 + 2 ;
}
ch = getchar();
}
PHONE[iter] = Sum;
}
//用快排对电话号码排序
qsort(PHONE, cnt, sizeof(int), cmp);
//输出排好顺序的号码
for(iter = 0, icount = 1; iter < cnt - 1 ; iter++)
{
icount = 1;
//统计重复号码个数
while(PHONE[iter] == PHONE[iter + 1])
{
iter++;
icount++;
}
if(icount > 1)
{
Noduplicates = 1;
printf("%03d-%04d %d\n",PHONE[iter] / 10000 ,PHONE[iter] % 10000 ,icount);
}
}
if(Noduplicates == 0)
{
printf("No duplicates.\n");
}
getchar();
return 0;
}
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
int cmp(const void *a, const void *b){
return(*(int *)a-*(int *)b);
}
int main(){
char str[100];
int num[26]={2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 0, 7, 7, 8, 8, 8, 9, 9, 9, 0};
int n, a[100005], l, sum, i, k, flag, t, s, j, p;
scanf("%d", &n);
getchar();
k = 0;
while (k!=n){
gets(str);
l = strlen(str);
sum = 0;
for (i=0; i<l; i++){
if (str[i]>= '0' && str[i] <= '9'){
sum = sum*10 + str[i]-'1'+1;
continue;
}
if (str[i]>='A' && str[i]<='Z'){
if (str[i] == 'Q' || str[i] == 'Z') continue;
sum = sum * 10 + num[str[i]-'A'];
}
}
a[k] = sum;
k++;
}
a[k] = -1;
qsort(a, k, sizeof(a[0]), cmp);
t = a[0];
flag = 0;
i = 1;
s = 1;
while (i!=k+1){
if (t == a[i]){
s++;
flag = 1;
}else {
if (s>1){
p = 1000000;
for(j=1; j<=3; j++){
printf("%d", t/p);
t = t%p;
p = p/10;
}
printf("-");
p = 1000;
for (j=1; j<=4; j++){
printf("%d", t/p);
t = t%p;
p = p/10;
}
printf(" %d\n", s);
}
t = a[i];
s=1;
}
i++;
}
if (flag == 0){
printf("No duplicates.\n");
}
return 0;
}