- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex4.py
More file actions
Latest commit
19 lines (18 loc) · 430 Bytes
/
Copy pathex4.py
File metadata and controls
19 lines (18 loc) · 430 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'''
输入某年某月某日,判断这一天是这一年的第几天?
'''
a=int(input("year:"))
b=int(input("month:"))
c=int(input("day:"))
day= [0,31,28,31,30,31,30,31,31,30,31,30]
sum=c
if ((a%100!=0) and (a%4==0)) or (a%100==0):
leap=1
else:
leap=0
foriinrange(12):
ifb>i:
sum+=day[i]
ifi==2:
sum+=leap
print("it's the "+str(sum) +"th day.")