user-0 提问: 求大佬看看，这段程序哪里有问题

回复:
user: user-1
content: 提问代码的问题，上面的回答已经说了，这里就不重复了。 只是对于这类语法错误，建议使用拥有「代码静态分析工具或插件」的文本编辑器或者IDE，这样的话，在编写代码阶段，代码静态分析工具或插件就能提示代码的语法错误，当然它还能指出其它一些潜在危险或错误。这就大大减轻了编写代码的负担，能让人更专注于代码和算法本身。 另外，下面提供一个代码供参考：  #include <stdio.h>  int main(int argc, char const *argv[]) { 	int year, month, day; 	int leap = 0; 	int day_num = 0; 	scanf("%d/%d/%d", &year, &month, &day); 	if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) 		leap = 1; 	switch (month) { 	case 12: 		day_num += 30; 	case 11: 		day_num += 31; 	case 10: 		day_num += 30; 	case 9: 		day_num += 31; 	case 8: 		day_num += 31; 	case 7: 		day_num += 30; 	case 6: 		day_num += 31; 	case 5: 		day_num += 30; 	case 4: 		day_num += 31; 	case 3: 		day_num += 28 + leap; // 这里是易错点。 	case 2: 		day_num += 31; 	case 1: 		day_num += day; 	} 	printf("%d", day_num); 	return 0; }

user: user-2
content: #include<stdio.h>  int main() {     int year,month,day,n, leap = 0;     printf("Input the year:");     scanf("%d",&year);     printf("Input the month:");     scanf("%d",&month);     printf("Input the day:");     scanf("%d",&day);      if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year %400 == 0))         leap = 1;     //switch(month):     switch(month)     {         case 1:             n = day;             break;         case 2:n=(day +31);                break;         case 3:n=(day +59);                break;         case 4:n=(day +90);                break;         case 5:n=(day +120);                break;         case 6:n=(day +151);                break;         case 7:n=(day +181);                break;         case 8:n=(day +212);                break;         case 9:n=(day +243);                break;         case 10:n=(day +273);                 break;         case 11:n=(day +304);                 break;         case 12:n=(day +334);                 break;     }     if (month > 2)         n += leap;      printf("the day is the %d day of the year\n",n);      return 0; }

user: user-2
content: #include<stdio.h>  int main() {     int year,month,day,n, leap = 0;     printf("Input the year:");     scanf("%d",&year);     printf("Input the month:");     scanf("%d",&month);     printf("Input the day:");     scanf("%d",&day);      if ((year % 4 == 0 && year % 100 != 0) || year %400 == 0)         leap = 1;     //switch(month):     switch(month)     {         case 1:             n = day;             break;         case 2:n=(day +31);                break;         case 3:n=(day +59);                break;         case 4:n=(day +90);                break;         case 5:n=(day +120);                break;         case 6:n=(day +151);                break;         case 7:n=(day +181);                break;         case 8:n=(day +212);                break;         case 9:n=(day +243);                break;         case 10:n=(day +273);                 break;         case 11:n=(day +304);                 break;         case 12:n=(day +334);                 break;     }     if (month > 2)         n += leap;      printf("the day is the %d day of the year\n",n);      return 0; }   供参考！  代码可以写的更精简一些

user: user-3
content: switch(month)后面多了一个: switch(month) {     .     .     .  }

user: user-4
content: switch(month)后面不能有冒号: