向大家求助下,谢谢!!!
今天便写了个程序,目的是输入某年某月输出该月对应的天数,但是程序出错,请大家帮忙看下,谢谢#include<stdio.h>
void main()
{ int year,m;
printf("请输入某年某月:\n");
scanf("%d,%d",&year,&m);
switch (year,m)
{case 4:
case 6:
case 9:
case 11:printf("days=30\n");break;
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:printf("days=31\n");break;
if( (year/4==0)&&(year/100!==0)||(year/400==0))
case 2:printf("days=29\n");break;
else
case 2:printf("days=28\n");break;
}
}