输入年份和月份,输出这一年的这一月有多少天。需要考虑闰年。
输入格式无
输出格式无
输入输出样例输入 #1
1926 8
输出 #1
31
输入 #2
2000 2
输出 #2
29题解 python
y, m = map(eval, input().split())
if m ==2 :
p1 = y % 4 == 0 # 被4整除是闰
p2 = y % 100 == 0 # 被100整除不是闰
p3 = y % 400 == 0 # 是闰
if p3 or (p1 & (not p2)):
print(29)
else:
print(28)
else:
if m in (1, 3, 5, 7, 8, 10, 12):
print(31)
else:
print(30)
c++
#includeusing namespace std; int y,m; int main() { cin >> y >> m; switch (m) { case 1: case 3: case 5: case 7: case 8: case 10: case 12:cout<<31<



