2007年9月15日

正则表达式语法

摘要: 例子: 使用python import re # lookaround str = '1234567890' regex = re.compile('(?' print re.match('', str).group() print re.match('', str).group() 使用perl #!/usr/bin/perl undef $/; # En... 阅读全文

posted @ 2007-09-15 20:43 cutepig 阅读(1030) 评论(0) 推荐(0) 编辑

无砝码天平3次称出12个小球中质量异常球问题

摘要: 无砝码天平3次称出12个小球中质量异常球问题 原题为: 有十二个小球特征相同,其中只有一个质量异常,要求用一部没有砝码的天平称三次,将那个质量异常的球找出来。 解: 设标准小球质量为w,并代表任意一个正常小球,将12个小球依次编号为a1,a2,...,a12,分组为: a1,a2 ,a3 ,a4 为A1组 a5,a6 ,a7 ,a8 为A2组 ... 阅读全文

posted @ 2007-09-15 19:35 cutepig 阅读(954) 评论(0) 推荐(0) 编辑

找最大重复字串

摘要: 找最大重复字串 http://www.chinaunix.net/jh/24/464277.html http://www.chinaunix.net 作者:bioinfor 发表于:2007-03-27 19:16:25 【发表评论】【查看原文】【Shell讨论区】【关闭】 1) Write a program to identify all the repetitive pattern... 阅读全文

posted @ 2007-09-15 19:32 cutepig 阅读(1048) 评论(0) 推荐(0) 编辑

导航