在python中,所有和正则表达式相关的功能都包含在re模块中。$表示字符串的末尾,^表示字符串的开始,原始字符串:字符串添加前缀r,表示字符串中的所有字符都不转义。\b表示单词的边界必须在这里。s="100 BROAD"re.sub('ROAD$','RD',s)结果:'100 BRD're.su...
分类:
编程语言 时间:
2014-07-19 20:38:28
阅读次数:
233
Another recursion-style problem.1. Each count of sub-solution with a certain root should contribute to final count2. With a certain root, the num of l...
分类:
其他好文 时间:
2014-07-18 18:18:01
阅读次数:
187
Sub OneTxt() '打开一个txt文件 Dim Filename As Variant, extLine&, mArr() As String Dim i%, j% ChDir ThisWorkbook.Path Filename = Application.GetO...
分类:
其他好文 时间:
2014-07-18 14:29:21
阅读次数:
149
Sub OneTxt() '打开一个txt文件 Dim Filename As Variant, extLine&, mArr() As String Dim i%, j%, txtpath As String Dim txtname As Variant C...
分类:
其他好文 时间:
2014-07-18 14:15:36
阅读次数:
205
Python的字典和JSON在表现形式上非常相似#这是Python中的一个字典 dic = { 'str': 'this is a string', 'list': [1, 2, 'a', 'b'], 'sub_dic': { 'sub_str': 'this is sub str', 'sub_l...
分类:
编程语言 时间:
2014-07-16 18:09:52
阅读次数:
301
1. 虚函数和纯虚函数可以定义在同一个类(class)中,含有纯虚函数的类被称为抽象类(abstract class),而只含有虚函数的类(class)不能被称为抽象类(abstract class)。 2.虚函数可以被直接使用,也可以被子类(sub class)重载以后以多态的形式调用,而纯虚函数...
分类:
编程语言 时间:
2014-07-16 17:05:43
阅读次数:
244
题意:给出一列数(n个),m次查询区间[l,r]的最大连续区间[x,y](l
思路:动态查询区间最大连续区间;
如果是求最大连续区间和:
用线段树维护最大连续和sum_sub、最大前缀和sum_prefix、最大后缀和sum_suffix。
root.sum_sub = max{l.sum_sub, r.sum_sub, (l.sum_suffix + r.sum_prefix)...
分类:
其他好文 时间:
2014-07-16 11:42:15
阅读次数:
222
Partition an array of integers around a value such taht all elements less than x come before elements greater than or equal to x.Idea: Just use of sub...
分类:
其他好文 时间:
2014-07-15 22:52:15
阅读次数:
239
在进行页面的DIV CSS排版时,遇到IE6(当然有时Firefox下也会偶遇)浏览器中的图片元素img下出现多余空白的问题绝对是常见的对于该问题的解决方法也是“见机行事”。1、将图片转换为块级对象即,设置img为“display:block;”。在本例中添加一组CSS代码:“#sub img {d...
分类:
其他好文 时间:
2014-07-15 09:05:52
阅读次数:
237
#includevoid main(){const int count = 5;//定义数量struct student{char name[80];float math,eng;float aver;}stu[count],temp;//输入for (int i = 0; i stu[sub].a...
分类:
编程语言 时间:
2014-07-14 21:23:30
阅读次数:
247