#include<stdio.h>
int judgeyear(int year){
int flag=0;//平年返回0
if ((year%4==0 && year%100 !=0) || year%400==0)
flag=1;//闰年返回1
return flag;
}
/*本题不考虑日期的合法性,输入的日期是合法的*/
int main(){
int year,month,day;
int dayNumber=0;
scanf("%d%d%d",&year,&month,&day);
switch (month){
case 12:dayNumber +=30;
case 11:dayNumber +=31;
case 10:dayNumber +=30;
case 9 :dayNumber +=31;
case 8 :dayNumber +=31;
case 7 :dayNumber +=30;
case 6 :dayNumber +=31;
case 5 :dayNumber +=30;
case 4 :dayNumber +=31;
case 3 :dayNumber +=30;//3月的情况,请填写多行代码
//2月的情况,请填写一行代码
case 1 :dayNumber +=30;//1月的情况,请填写多行代码
default:printf("Input error!");
}
printf("%d",dayNumber);
}
补充2月的情况的代码,
应该怎么把闰年判断写到那?