正常的def pig_it(): word = 'Pig latin is cool ' wordList = word.split() re = '' for item in wordList: if item.isalpha(): head = item[1:] ass = item[0]+'a ...
分类:
其他好文 时间:
2017-07-08 22:01:13
阅读次数:
286
在Java中,从1.5开始,我们就可以使用泛型了(generic),这看上去很像C++ Template,但是实际上它们是不同的。在这里我不想过多的描述细节,你可以从Google上搜索一下。 但是,泛型已经变得如此复杂,以至于已经有500多页的 FAQ。 我们长话短说:泛型提供了编译时类型安全,所以 ...
分类:
其他好文 时间:
2017-07-06 23:51:20
阅读次数:
267
A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program ...
分类:
其他好文 时间:
2017-07-06 15:14:53
阅读次数:
211
题目链接:uva 12050 - Palindrome Numbers 题意:求第n个回文串 思路:首先可以知道的是长度为k的回文串个数有9*10^(k-1),那么依次计算,得出n是长度为多少的串,然后就得到是长度为多少的第几个的回文串了,有个细节注意的是, n计算完后要-1! 下面给出AC代码: ...
分类:
其他好文 时间:
2017-07-04 11:12:00
阅读次数:
131
12050 - Palindrome Numbers Time limit: 3.000 seconds A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, ...
分类:
其他好文 时间:
2017-07-03 22:25:31
阅读次数:
170
翻译 给定一个单链表,确定它是否是回文的。 跟进: 你能够在O(n)时间和O(1)空间下完毕它吗? 原文 Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) t ...
分类:
其他好文 时间:
2017-07-03 21:07:59
阅读次数:
126
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the name “anna” is a palindrome. Numbers can also be ...
分类:
其他好文 时间:
2017-07-03 20:00:11
阅读次数:
153
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the name “anna” is a palindrome. Numbers can also be ...
分类:
其他好文 时间:
2017-07-03 19:14:00
阅读次数:
123
面向对象的程序设计一(类和对象) 1 ''' 2 对象一 3 name="fang" 4 age=28 5 country="shina" 6 7 技能 8 def talk(self): 9 print("is talking") 10 11 def eat(self): 12 print("is ...
分类:
其他好文 时间:
2017-07-03 19:12:34
阅读次数:
199
“回文”是指正读反读都能读通的句子。它是古今中外都有的一种修辞方式和文字游戏,如“我为人人,人人为我”等。在数学中也有这样一类数字有这种特征,成为回文数(palindrome number)。 设n是一随意自然数。若将n的各位数字反向排列所得自然数n1与n相等,则称n为一回文数。比如,若n=1234 ...
分类:
编程语言 时间:
2017-07-02 21:16:54
阅读次数:
302