Problem A. Read Phone Number
来源:互联网 发布:淘宝和农村淘宝互通吗 编辑:程序博客网 时间:2024/06/05 15:48
Problem
Do you know how to read the phone numbers in English? Now let me tell you.
For example, In China, the phone numbers are 11 digits, like: 15012233444. Someone divides the numbers into 3-4-4 format, i.e. 150 1223 3444. While someone divides the numbers into 3-3-5 format, i.e. 150 122 33444. Different formats lead to different ways to read these numbers:
150 1223 3444 reads one five zero one double two three three triple four.
150 122 33444 reads one five zero one double two double three triple four.
Here comes the problem:
Given a list of phone numbers and the dividing formats, output the right ways to read these numbers.
Rules:
Single numbers just read them separately.
2 successive numbers use double.
3 successive numbers use triple.
4 successive numbers use quadruple.
5 successive numbers use quintuple.
6 successive numbers use sextuple.
7 successive numbers use septuple.
8 successive numbers use octuple.
9 successive numbers use nonuple.
10 successive numbers use decuple.
More than 10 successive numbers read them all separately.
Input
The first line of the input gives the number of test cases, T. T lines|test cases follow. Each line contains a phone number N and the dividing format F, one or more positive integers separated by dashes (-), without leading zeros and whose sum always equals the number of digits in the phone number.
Output
For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is the reading sentence in English whose words are separated by a space.
Limits
1 ≤ T ≤ 100.
Small dataset
1 ≤ length of N ≤ 10.
Large dataset
1 ≤ length of N ≤ 100.
Sample
- Problem A. Read Phone Number
- Problem A. Read Phone Number
- Problem A. Read Phone Number -模拟读电话号码
- Round A China New Grad Test 2014 Problem A. Read Phone Number
- Google中国2014校园招聘笔试Round A China New Grad Test Problem A. Read Phone Number
- Google of Greater China Test for New Grads of 2014---很水的一道题Problem A. Read Phone Number
- Read Phone Number
- Read Phone Number
- Read Phone Number
- Read Phone Number
- acdream1188 Read Phone Number 水题
- Read Phone Number - Round A China New Grad Test 2014 - 循环控制
- Phone Number 山东省第一届ACM大学生程序设计竞赛(原题) problem A
- Google Code Jam Notes - Read Phone Number - Java
- ACdream 1188 Read Phone Number(字符串:模拟)
- LeetCode: Letter Combinations of a Phone Number
- LeetCode Letter Combinations of a Phone Number
- LeetCode: Letter Combinations of a Phone Number
- weblogic 不能启动
- CMUX帧结构以及开启
- 建立OpenCV 框架
- windows注册与删除tomcat服务
- 工作流引擎创建
- Problem A. Read Phone Number
- Problem B. Rational Number Tree
- Problem C. Sorting
- poj 1328 Radar Installation
- 超详细mysql left join,right join,inner join用法分析
- 罗马假日
- Problem D. Cross the maze
- 图的广度、深度遍历
- MySql中的标准差函数 STD, STDDEV_SAMP