Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2015-11-17 08:24:43
阅读次数:
199
题目链接:http://poj.org/problem?id=1686思路分析:该问题为表达式求值问题,对于字母使用浮点数替换即可,因为输入中的数字只能是单个digit。代码如下:#include #include #include #include #include #include using ...
分类:
其他好文 时间:
2015-11-17 00:12:38
阅读次数:
224
Computer TransformationTime Limit:1000MSMemory Limit:65536KTotal Submissions:4548Accepted:1731DescriptionA sequence consisting of one digit, the numbe...
分类:
其他好文 时间:
2015-11-16 19:30:15
阅读次数:
126
BASH中的通配符(wildcard)*:任意长度的任意字符。
?:任意单个字符
[]:匹配范围
[^]:排除匹配范围
[:alnum:][:alpha:][:blank:][:cntrl:]
[:digit:][:graph:][:lower:][:print:]
[:punct:][:space:][:upper:][:xdigit:]正则表达式.:表示匹配任意单个字符。
*:表示匹配前..
分类:
其他好文 时间:
2015-11-09 19:11:14
阅读次数:
206
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6...
分类:
其他好文 时间:
2015-11-09 12:33:27
阅读次数:
136
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, r...
分类:
其他好文 时间:
2015-11-08 19:29:06
阅读次数:
231
Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ...
分类:
其他好文 时间:
2015-11-08 14:30:48
阅读次数:
226
ctype_alnum— 检查字符串中只包含数字或字母,相当于正则[A-Za-z0-9].ctype_alpha— 检查字符串中只包含字母。ctype_cntrl— 检查字符串中是否只包含" '\n' '\r' '\t' " 这样的控制字符。ctype_digit— 检查字符串中是否只包含数字。ct...
分类:
Web程序 时间:
2015-11-05 18:45:55
阅读次数:
180
原题链接在这里:https://leetcode.com/problems/integer-to-english-words/没三个digit分成一个 unit, 用unitNumber 函数把这三位数换算成数字加上对应的unit.Note: num = 1,000,000时不可以出现 "One M...
分类:
其他好文 时间:
2015-11-05 06:06:15
阅读次数:
157
Simply a variation to "Permutation Index". When calculating current digit index, we consider duplicated case.Again, similar as "Digit Counts", it is a...
分类:
其他好文 时间:
2015-11-04 09:17:18
阅读次数:
361