s="123 abc !@# ^&*" digit_num=0 letter_num=0 space_num=0 other_num=0 for i in s: if i.isalpha(): letter_num+=1 elif i.isdigit(): digit_num+=1 elif i.i ...
分类:
其他好文 时间:
2018-07-02 20:23:39
阅读次数:
135
题目描述 FJ and his cows enjoy playing a mental game. They write down the numbers from 11 to N(1 \le N \le 10)N(1≤N≤10) in a certain order and then sum ad ...
分类:
其他好文 时间:
2018-06-28 20:22:16
阅读次数:
171
规律题 对x (0-4) 来说 ,x对S(2n)的贡献为2*x ,对x (5-9) ,x对s(2n)的贡献为2*x-9 我们假设x(5-9)的个数为l个,则S(2n)=2S(n)-9l , 与a*S(n)=b*S(2n) 合并后 式子为S(n)*(2b-a)=9bl S(n):l = 9b:(2b- ...
分类:
其他好文 时间:
2018-06-26 15:02:42
阅读次数:
157
问题描述: Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest pa ...
分类:
其他好文 时间:
2018-06-25 11:02:23
阅读次数:
249
用户输入姓名、年龄、职业、工资后打印信息: %s 代表字符串 string %d 代表整数 digit %f 代表浮点数 flloat ...
分类:
其他好文 时间:
2018-06-16 14:28:28
阅读次数:
123
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le ...
分类:
移动开发 时间:
2018-06-16 10:30:42
阅读次数:
265
是说自然数序列看成一个长字符串,问我们第N位上的数字是什么。那么这道题的关键就是要找出第N位所在的数字,然后可以把数字转为字符串,这样直接可以访问任何一位。那么我们首先来分析自然数序列和其位数的关系,前九个数都是1位的,然后10到99总共90个数字都是两位的,100到999这900个数都是三位的,那 ...
分类:
其他好文 时间:
2018-06-10 12:04:38
阅读次数:
180
1069 The Black Hole of Numbers (20)(20 分) For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-inc ...
分类:
其他好文 时间:
2018-06-09 19:46:01
阅读次数:
160
X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be rotate ...
分类:
其他好文 时间:
2018-06-08 14:08:55
阅读次数:
166
问题 G: Digit Sum II 题目描述 For integers b(b≥2) and n(n≥1), let the function f(b,n) be defined as follows:·f(b,n)=n, when n<b·f(b,n)=f(b,floor(n?b))+(n mo ...
分类:
其他好文 时间:
2018-05-29 22:57:20
阅读次数:
175