XXX公司的入职试题(时间:两小时)

XXX公司的入职试题(时间:两小时)

Description

Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of Waterloo by dialing the memorable TUT-GLOP. Sometimes only part of the number is used to spell a word. When you get back to your hotel tonight you can order a pizza from Gino’s by dialing 310-GINO. Another way to make a telephone number memorable is to group the digits in a memorable way. You could order your pizza from Pizza Hut by calling their “three tens” number 3-10-10-10. 

The standard form of a telephone number is seven decimal digits with a hyphen between the third and fourth digits (e.g. 888-1200). The keypad of a phone supplies the mapping of letters to numbers, as follows: 

A, B, and C map to 2 
D, E, and F map to 3 
G, H, and I map to 4 
J, K, and L map to 5 
M, N, and O map to 6 
P, R, and S map to 7 
T, U, and V map to 8 
W, X, and Y map to 9 

There is no mapping for Q or Z. Hyphens are not dialed, and can be added and removed as necessary. The standard form of TUT-GLOP is 888-4567, the standard form of 310-GINO is 310-4466, and the standard form of 3-10-10-10 is 310-1010. 

Two telephone numbers are equivalent if they have the same standard form. (They dial the same number.) 

Your company is compiling a directory of telephone numbers from local businesses. As part of the quality control process you want to check that no two (or more) businesses in the directory have the same telephone number. 

Input

The input will consist of one case. The first line of the input specifies the number of telephone numbers in the directory (up to 100,000) as a positive integer alone on the line. The remaining lines list the telephone numbers in the directory, with each number alone on a line. Each telephone number consists of a string composed of decimal digits, uppercase letters (excluding Q and Z) and hyphens. Exactly seven of the characters in the string will be digits or letters. 

Output

Generate a line of output for each telephone number that appears more than once in any form. The line should give the telephone number in standard form, followed by a space, followed by the number of times the telephone number appears in the directory. Arrange the output lines by telephone number in ascending lexicographical order. If there are no duplicates in the input print the line: 

No duplicates. 

Sample Input

12
4873279
ITS-EASY
888-4567
3-10-10-10
888-GLOP
TUT-GLOP
967-11-11
310-GINO
F101010
888-1200
-4-8-7-3-2-7-9-
487-3279

Sample Output

310-1010 2
487-3279 4
888-4567 3

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/100509.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • R语言ggplot画图(autocad命令输入方式有几种)

    提到R语言,总会想到它强大的绘图包ggplot2,甚至于其他语言中也有它的痕迹(例如,python中的matplotlib模块就有ggplot样式)。以下,总结了一些日常绘图中常用的命令。目录一、基本绘图二、精雕细琢三、ggplot中的数据变换一、基本绘图二、精雕细琢(1)图片标题字体、大小、样式设置(2)坐标轴字体、大小、样式设置(3)颜色设置I.指定颜色scale_fill_manual(value=c())II.使用调色板RColorBrewer::displ

  • ccs软件的使用(靠谱挣钱的app软件)

    1.使用CCS3.3编译TI的28335,产生如下警告:warning:entry-pointsymbolotherthan”_c_int00″specified: “code_start”一种解决方法,不用管它,因为C入口地址最终是由用户的CMD文件覆盖的,警告不影响使用。二是,在编译选项里面link标签页,把CodeEntryPoint(-e)编辑框

  • datagrip激活码2020 mac_通用破解码

    datagrip激活码2020 mac_通用破解码,https://javaforall.cn/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

  • es6模板字符串_es6字符串模板

    es6模板字符串_es6字符串模板模板字符串主要用于插入表达式!

  • C/C++条件运算符你不知道的那些事[通俗易懂]

    C/C++条件运算符你不知道的那些事[通俗易懂]VS2013示例,条件运算符代码部分代码运行结果如下图VS2013示例,条件运算符代码部分代码运行结果如下图3.4.26条件运算符示例1、条件运算符仅优先于赋值运算符。2、条件运算符的结合方向为“自右到左”。3、VS2013示例,条件运算符执行语句代码部分4、代码运行结果如下图…

  • mysql怎么加载数据库_如何导入mysql数据库

    mysql怎么加载数据库_如何导入mysql数据库展开全部方法一:1、首先我e68a84e8a2ad3231313335323631343130323136353331333363393134们使用MySQL提供的命令行界面来导入数据库,确保自己的电脑中安装了MySQL数据库,我们可以通过命令行来确认是否安装了MySQL数据库,当然,第一步是打开Mysql的数据库服务,我们使用命令行来打开,2、启动MySQL后,我们找到需要用到的脚本文件,也就是…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号