六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 52|回复: 0

面试题~~

[复制链接]

升级  35%

91

主题

91

主题

91

主题

举人

Rank: 3Rank: 3

积分
305
 楼主| 发表于 2013-1-27 04:48:42 | 显示全部楼层 |阅读模式
一家公司 给我出的面试题。。呵呵,蛮简单的。。就是好久没写了。。昨天完成了。有兴趣可以做做。。温故以前知识。
<span style="">
<span style="">Write a program that can compute the number of unique, valid phone numbers with the following constraints:
<span style="font-family: Times New Roman;">a)       A valid phone number is seven digits in length
<span style="font-family: Times New Roman;">b)       A valid phone number cannot begin with a zero or a one
<span style="font-family: Times New Roman;">c)       A valid phone number can contain only digits
<span style="font-family: Times New Roman;">d)       A valid phone number must consist of a sequence of digits that can be traced by the movements of a chess piece on a normal telephone keypad
 
1

2

3

4

5

6

7

8

9

*

0

<span style="font-family: Times New Roman;">#

您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表