C语言实验——某年某月的天数
Time Limit: 1000 ms Memory Limit: 65536 KiB
Problem Description
输入年和月,判断该月有几天?
Input
输入年和月,格式为年\月。
Output
输出该月的天数。
Sample Input
2009\1
Sample Output
31
Hint
注意判断闰年啊
f=0
time=input().split('\\')
year=int(time[0])
month=int(time[1])
if((year%4==0 and year%100!=0)or (year%400==0)):
f=1
if(month==4 or month==6 or month==9 or month==11):
print("30")
elif(month==2 and f==1):
print("29")
elif(month==2 and f==0):
print("28")
else:
print("31")