for i in range(1,10): for j in range(1,i+1): print
(" ".join(["%d*%d=%d" %(j,i,i*j)]))[root@miller qinbin]# python test.py
1*1=11*2=2 2*2=41*3=3 2...
分类:
编程语言 时间:
2014-05-26 20:34:16
阅读次数:
388
Given a linked list and a value x, partition it
such that all nodes less than x come before nodes greater than or equal to x.You
should preserve the o...
分类:
其他好文 时间:
2014-05-26 09:35:28
阅读次数:
266
'''
【程序61】
题目:打印出杨辉三角形(要求打印出10行如下图)
1.程序分析:
'''
if __name__ == '__main__':
a = []
for i in range(10):
a.append([])
for j in range(10):
a[i].append(0)
for i...
分类:
编程语言 时间:
2014-05-25 00:52:00
阅读次数:
436
'''
【程序81】
题目:809*??=800*??+9*??+1 其中??代表的两位数,8*??的结果为两位数,9*??的结果为3位数。求??代表的两位数,及809*??后的结果。
1.程序分析:
2.程序源代码
这个程序实在是奇怪
0 = 1 :(
就写个程序而已,不去追究了
'''
a = 809
for i in range(10,100):
b = i * a + 1
...
分类:
编程语言 时间:
2014-05-24 14:15:21
阅读次数:
321
list构造函数://default:list l; //空的list//fill:list
l(n); //n个元素, 元素默认初始化list l(n, value); //n个元素值为value//range:list l(fir...
分类:
其他好文 时间:
2014-05-23 09:49:56
阅读次数:
314
1 #include 2 //quickSort 3 int partition(int
a[],int start,int end) { 4 int node = a[start]; //初始节点 5 while(start= node
&& end > start) ...
分类:
其他好文 时间:
2014-05-23 04:04:22
阅读次数:
304
Linux系统通过软限制和硬限制,制约了打开文件的最大个数,而且每个端口侦听的连接数受限于/etc/sytctl.conf中的ip_local_port_range的范围,那么nginx是如何做到轻量级和高并发的。
Nginx的进程模型
各个work进程间通过accept_mutex互斥锁进行连接的获取,以防止惊群现象的发生(即所有进程都收到通知,却...
分类:
其他好文 时间:
2014-05-22 17:11:39
阅读次数:
364
Given a linked list and a valuex, partition it
such that all nodes less thanxcome before nodes greater than or equal tox.You
should preserve the origi...
分类:
其他好文 时间:
2014-05-22 03:53:29
阅读次数:
313
在Heat中完全使用aws的语法创建一套autoscaling的template。
流程:
Create LaunchConfig (Create basic instance, send mem status to ALARM) ->
Create ASGroup (Define instance num range) ->
Create ScaleUpPolicy (+1 in...
分类:
其他好文 时间:
2014-05-21 16:01:10
阅读次数:
315
最近编写Python程序时经常遇见中文相关的问题,这里说一个问题的解决方法。
我在使用json模块的dumps()函数时,因为涉及到中文,报出如下错误:
ascii codec can't decode byte 0xe8 in position 0:ordinal not in range(128)
这是编码相关的问题,在该程序中加入如下代码:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
这样就可以解决该问题了,希望对大家有所帮助。...
分类:
编程语言 时间:
2014-05-21 09:47:21
阅读次数:
323