自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 问答 (1)
  • 收藏
  • 关注

原创 POJ_Biorhythms_递归_中国剩余定理求解

BiorhythmsTime Limit: 1000MS Memory Limit: 10000KDescriptionSome people believe that there are three cycles in a person’s life that start the day he or she is born. These three cycles are the phys

2016-09-27 16:31:13 364

原创 POJ_I Think I Need a Houseboat

I Think I Need a HouseboatTime Limit: 1000MS Memory Limit: 10000KDescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the

2016-09-26 10:27:40 312

原创 POJ_Hangover

Hangover Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 95164 Accepted: 46128 DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can

2016-09-25 23:57:58 346

原创 urllib2下载网页的三种方法_Python爬虫

# -*-coding:gbk-*-'''urllib2下载网页的三种方法'''import urllib2,cookieliburl='http://www.baidu.com'#直接请求print u'第一种方法_直接请求'response1=urllib2.urlopen(url)print response1.getcode()print len(response1.read(

2016-09-04 10:38:42 1023

原创 Python返回函数_函数闭包_lambda匿名函数

闭包 在函数内部定义的函数和外部定义的函数是一样的,只是他们无法被外部访问:def g(): print 'g()...'def f(): print 'f()...' return g将 g 的定义移入函数 f 内部,防止其他代码调用 g:def f(): print 'f()...' def g(): print 'g()...'

2016-09-03 21:05:10 411

原创 Python实现dict转换成HTML表格

使用for循环的迭代不仅可以迭代普通的list,还可以迭代dict。假设有如下的dict:d = { ‘Adam’: 95, ‘Lisa’: 85, ‘Bart’: 59 } 完全可以通过一个复杂的列表生成式把它变成一个 HTML 表格:tds = [‘%s%s’ % (name, score) for name, score in d.iteritems()] print ‘’ print

2016-09-03 12:14:29 5770

原创 汉诺伊塔 的Python基本实现

汉诺塔 (http://baike.baidu.com/view/191666.htm) 的移动也可以看做是递归函数。我们对柱子编号为a, b, c,将所有圆盘从a移到c可以描述为:如果a只有一个圆盘,可以直接移动到c;如果a有N个圆盘,可以看成a有1个圆盘(底盘) + (N-1)个圆盘,首先需要把 (N-1) 个圆盘移动到 b,然后,将 a的最后一个圆盘移动到c,再将b的(N-1)个圆盘移动到c。

2016-09-03 10:25:07 880

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除