输入年份和月份,判断是否为闰年并输出该年份月份的天数是多少
#include<stdio.h>
int main(){
int year,month;
scanf("%d %d",&year,&month);
if(year%400==0||(year%100!=0&&year%4==0)){
printf("%d是闰年。",year);
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
printf("%d年%d月有31天。",year,month);
}else if(month==4||month==6||month==9||month==11){
printf("%d年%d月有30天。",year,month);
}else if(month==2){
printf("%d年%d月有29天。",year,month);
}
}else{
printf("%d不是闰年。",year);
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
printf("%d年%d月有31天。",year,month);
}else if(month==4||month==6||month==9||month==11){
printf("%d年%d月有30天。",year,month);
}else if(month==2){
printf("%d年%d月有28天。",year,month);
}
}
return 0;
}