标签:style blog color ar for 2014 div sp log
题目:
输入某年某月某日,判断这一天是这一年的第几天?
def judge_run(year): a=year/4.0; b=year/100.0; c=year/400.0; if a==int(a) and b!=int(b): return 1 if c==int(c): return 1 return 0 def judge_day(year,month,day): m1=[31,28,31,30,31,30,31,31,30,31,30,31]; y=judge_run(year); m=0; for i in range(0,month-1): m=m+m1[i]; if month>2: m=m+y; return m+day; print judge_day(2014,9,12)
标签:style blog color ar for 2014 div sp log
原文地址:http://www.cnblogs.com/verstin/p/3968299.html