- Notifications
You must be signed in to change notification settings - Fork 519
Expand file tree
/
Copy pathDayofprogrammer
More file actions
Latest commit
47 lines (47 loc) · 1.15 KB
/
Copy pathDayofprogrammer
File metadata and controls
47 lines (47 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/python
importsys
y=int(raw_input().strip())
# your code goes here
months= {0:31,1:28,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31}
ify<=1917:
tot=0
foriinrange(12):
iftot+months[i] >256:
break
ify%4==0andi==1:
tot=tot+29
else:
tot=tot+months[i]
ans=""
day=256-tot
month=i+1
ans=ans+str(day) +".0"+str(month) +"."+str(y)
printans
elify==1918:
tot=0
foriinrange(12):
iftot+months[i] >256:
break
ifi==1:
tot=tot+15
else:
tot=tot+months[i]
ans=""
day=256-tot
month=i+1
ans=ans+str(day) +".0"+str(month) +"."+str(y)
printans
else:
tot=0
foriinrange(12):
iftot+months[i] >256:
break
if (y%400==0or (y%4==0andy%100!=0)) andi==1:
tot=tot+29
else:
tot=tot+months[i]
ans=""
day=256-tot
month=i+1
ans=ans+str(day) +".0"+str(month) +"."+str(y)
printans