04 2014 档案

只有注册用户登录后才能阅读该文。
posted @ 2014-04-25 15:19 再見理想
摘要:两分法查找的前提:顺序方式存储,而且必须是排好序直接上代码:function search($array, $target, $low = 0, $high = 0){ $len = count($array); $low = max($low, 0); $high = $high... 阅读全文
posted @ 2014-04-25 12:06 再見理想
摘要:1 # Filename:mysql_class.py 2 # Author:Rain.Zen; Date: 2014-04-15 3 4 import MySQLdb 5 6 class MyDb: 7 8 '''初始化[类似于构造函数]''' 9 def... 阅读全文
posted @ 2014-04-15 19:31 再見理想
摘要:直接上代码:# while.pynumber = 23isRun = Truewhile isRun: intt = int(raw_input('请输入一个整数 : ')) if intt == number: print '恭喜您, 您猜对了.' isRun = False elif intt < number: print '哎呀,您的数字小了.' else: print '哎呀,您的数字大了.' else: print '呵呵,循环完毕.' 阅读全文
posted @ 2014-04-11 19:41 再見理想
摘要:直接上代码:$str = '192.168.2.100';echo 'IP:',$str,'';$int = ip_long($str);echo $int,'';echo long_ip($int);function ip_long($ip) { $ary = explode('.', $ip); return count($ary) == 4 ? $long = $ary[0] + ($ary[1] 255 ? ($int & 255).'.'.(($int >> 8) &a 阅读全文
posted @ 2014-04-10 16:36 再見理想