题解 | #获得月份天数#
获得月份天数
https://www.nowcoder.com/practice/13aeae34f8ed4697960f7cfc80f9f7f6
#include <stdio.h> int main() { int a, b; while (scanf("%d %d",&a,&b)!=EOF){ if(a%400==0||(a%4==0&&a%100!=0)){ int arr[12]={31,29,31,30,31,30,31,31,30,31,30,31}; printf("%d\n",arr[b-1]); } else { int arr2[12]={31,28,31,30,31,30,31,31,30,31,30,31}; printf("%d\n",arr2[b-1]); } } return 0; }