小白看到看不懂的编译错误脸都绿了求大神不吝赐教

Q221.(10分)编程从键盘输入某年某月(包括闰年),用switch语句编程输出该年的该月拥有的天数。要求考虑闰年以及输入月份不在合法范围内的情况。已知闰年的2月有29天,平年的2月有28天。
**输入格式要求:"%d, %d" 提示信息:"Input year,month:"
**输出格式要求:"31 days\n" "29 days\n" "28 days\n" "Input error!\n"
程序运行示例如下:
Input year,month:2004,2
29 days
小白的程序:
#include
int main()
{
int year,month;
printf("Input year,month:");
scanf("%d,%d",&year,&month);
switch(month)
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
printf("31 days\n");
break;
case 4:
case 6:
case 9:
case 11:
printf("30 days\n");
break;
case 2:
if((year%4==0&&year%100!=0)||(year%400==0))
printf("29 days\n");
break;
else
printf("28 days\n");
break;
default
printf("Input error!\n");
return 0;
}
哪里出了问题求大神讲讲

具体错误是什么?
大致看一眼,应该是少了switch的括号对,需要用{}case .. default内容括起来。
还有default后面少了冒号。

int year = 0,
int month=0

初始化的时候要赋值

switch (month) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
System.out.println("31 days\n");
break;
case 4:
case 6:
case 9:
case 11:
System.out.println("30 days\n");
break;
case 2:
if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
System.out.println("29 days\n");
break;
} else
System.out.println("28 days\n");
break;
default:
System.out.println("Input error!\n");
}
java版的,没有问题。

 int main()
{
    int year,month;
    printf("Input year,month:"); 
    scanf("%d,%d",&year,&month);
    switch(month)
    {
     case 1:
     case 3:
     case 5:
     case 7:
     case 8:
     case 10:
     case 12:
         printf("31 days\n");
         break;
     case 4:
     case 6:
     case 9:
     case 11:
         printf("30 days\n");
         break;
     case 2:
         if((year%4==0&&year%100!=0)||(year%400==0))
         {
             printf("29 days\n");
         }
         else
         {
             printf("28 days\n");
         }
         break;
     default:
        printf("Input error!\n");
        return 0;
    }
}