user-0 提问: vs中的一个报错信息，类别为：错误（活动）

回复:
user: user-1
content: VS2015+Windows10 64位调试没问题，只要将scanf改为scanf_s，将getchar改为_getchar即可

user: user-2
content: #include <stdio.h>   struct y_m_d {     int year;     int month;     int day; }date903;  int months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};  int days903(struct y_m_d date1);  int main() {     printf("input year,month,day:");     scanf("%d,%d,%d", &date903.year, &date903.month, &date903.day);     printf("%d/%d is the %ith day in %d.\n", date903.month, date903.day, days903(date903), date903.year);     getchar();      return 0; }  int days903(struct y_m_d date1) {     int sum = 0, i;      for (i = 0; i < date1.month - 1; i++)         sum += months[i];     sum += date1.day;      if (((date1.year % 4 == 0 && date1.year % 100 != 0)         || date1.year % 400 == 0) && date1.month >= 3)         sum += 1;      return sum; } 改一下你的代码；

user: user-2
content: #include <stdio.h>   struct y_m_d {     int year;     int month;     int day; }date903;  int days903(struct y_m_d date1);  int main() {     printf("input year,month,day:");     scanf("%d,%d,%d", &date903.year, &date903.month, &date903.day);     printf("%d/%d is the %ith day in %d.\n", date903.month, date903.day, days903(date903), date903.year);     getchar();      return 0; }  int days903(struct y_m_d date1) {     int sum;     switch (date1.month)     {         case 1:             sum = date1.day;             break;         case 2:             sum = date1.day + 31;             break;         case 3:             sum = date1.day + 59;             break;         case 4:             sum = date1.day + 90;             break;         case 5:             sum = date1.day + 120;             break;         case 6:             sum = date1.day + 151;             break;         case 7:             sum = date1.day + 181;             break;         case 8:             sum = date1.day + 212;             break;         case 9:             sum = date1.day + 243;             break;         case 10:             sum = date1.day + 273;             break;         case 11:             sum = date1.day + 304;             break;         case 12:             sum = date1.day + 334;             break;     }     if (((date1.year % 4 == 0 && date1.year % 100 != 0) || date1.year % 400 == 0) && date1.month >= 3)         sum += 1;     return sum; } 代码没问题，  if (((date1.year % 4 == 0 && date1.year % 100 != 0) || date1.year % 400 == 0) && date1.month >= 3) 这条语句注意要多加上一对括号～

user: user-0
content: struct y_m_d { 	int year; 	int month; 	int day; }date903;  int main() { 	int days903(struct y_m_d date1); 	printf("input year,month,day:"); 	scanf("%d,%d,%d", &date903.year, &date903.month, &date903.day); 	printf("%d/%d is the %ith day in %d.\n", date903.month, date903.day, days903(date903), date903.year); 	getch();  	return 0; }  int days903(struct y_m_d date1) { 	int sum; 	switch (date1.month) 	{ 		case 1: 			sum = date1.day; 			break; 		case 2: 			sum = date1.day + 31; 			break; 		case 3: 			sum = date1.day + 59; 			break; 		case 4: 			sum = date1.day + 90; 			break; 		case 5: 			sum = date1.day + 120; 			break; 		case 6: 			sum = date1.day + 151; 			break; 		case 7: 			sum = date1.day + 181; 			break; 		case 8: 			sum = date1.day + 212; 			break; 		case 9: 			sum = date1.day + 243; 			break; 		case 10: 			sum = date1.day + 273; 			break; 		case 11: 			sum = date1.day + 304; 			break; 		case 12: 			sum = date1.day + 334; 			break; 	} 	if ((date1.year % 4 == 0 && date1.year % 100 != 0 || date1.year % 400 == 0) && date1.month >= 3) 		sum += 1; 	return sum; }

user: user-2
content: 把你的代码贴出来，大家帮你分析一下