if#!/usr/bin/pythonnumber=23guess=int(input('Enter an interger:')) #input返回的结果是string类型,需要用int()转化为int类型if guess == number: print('You guessed in.'...
分类:
编程语言 时间:
2014-09-07 11:01:14
阅读次数:
248
Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string b...
分类:
其他好文 时间:
2014-09-06 22:37:44
阅读次数:
208
Description
Problem H: Queuing at the doctors
Due to the increasing number of weird viruses spreading around, all the members of the International Confederation of Revolver Enthusiasts (ICORE) ar...
分类:
其他好文 时间:
2014-09-06 21:21:44
阅读次数:
369
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol...
分类:
其他好文 时间:
2014-09-06 21:18:33
阅读次数:
263
判断一个 int 是否为回文的有一点要注意的是:int x;int _x = abs(x);对 x 取绝对值的时候,会发生溢出。比如 x = INT_MIN 即 -2147483648 而 INT_MAX 为2147483647其实,负数不是回文数
分类:
其他好文 时间:
2014-09-06 21:08:53
阅读次数:
163
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...
分类:
其他好文 时间:
2014-09-06 18:40:43
阅读次数:
224
注意题目中的一句话:If a number m has bigger evaluating value than all the numbers smaller than it。。。这让我重新想过反素数的定义,应该 是比n小的数的约数的个数都 小于 n。所以,应该取最小的一个值#include #i...
分类:
其他好文 时间:
2014-09-06 17:21:53
阅读次数:
158
Jack Straws
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 3155
Accepted: 1418
Description
In the game of Jack Straws, a number of plastic or wooden "straws...
分类:
其他好文 时间:
2014-09-06 14:53:53
阅读次数:
270
js 数据类型 undefined 未定义boolean 布尔值string 字符串number 数值object 对象后者null;function 函数数字转化Number(); parseInt(); parseFloat(); 可以把非数字转化成数字Number();...
分类:
Web程序 时间:
2014-09-06 13:38:33
阅读次数:
194
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then le...
分类:
其他好文 时间:
2014-09-06 12:20:23
阅读次数:
171