user-0 提问: 求大神解答，程序哪里有问题！

回复:
user: user-1
content: 再纠正为： if ((a%4==0 && a%100!=0) || a%400==0) {  printf("这是闰年%d年的",a);  switch(b) {   case  1:printf("第%d天\n",c    );break;   case  2:printf("第%d天\n",c+ 31);break;   case  3:printf("第%d天\n",c+ 60);break;   case  4:printf("第%d天\n",c+ 91);break;   case  5:printf("第%d天\n",c+121);break;   case  6:printf("第%d天\n",c+152);break;   case  7:printf("第%d天\n",c+182);break;   case  8:printf("第%d天\n",c+213);break;   case  9:printf("第%d天\n",c+244);break;   case 10:printf("第%d天\n",c+274);break;   case 11:printf("第%d天\n",c+305);break;   case 12:printf("第%d天\n",c+335);break;  } } else {  printf("这是平年%d年的",a);  switch(b) {   case  1:printf("第%d天\n",c    );break;   case  2:printf("第%d天\n",c+ 31);break;   case  3:printf("第%d天\n",c+ 59);break;   case  4:printf("第%d天\n",c+ 90);break;   case  5:printf("第%d天\n",c+120);break;   case  6:printf("第%d天\n",c+151);break;   case  7:printf("第%d天\n",c+181);break;   case  8:printf("第%d天\n",c+212);break;   case  9:printf("第%d天\n",c+243);break;   case 10:printf("第%d天\n",c+273);break;   case 11:printf("第%d天\n",c+304);break;   case 12:printf("第%d天\n",c+334);break;  } }

user: user-1
content: 上帖纠正为： if ((a%4==0 && a%100!=0) || a%400==0) {  printf("这是闰年%d年的",a); } else {  printf("这是平年%d年的",a); } switch(b) {  case  1:printf("第%d天\n",c    );break;  case  2:printf("第%d天\n",c+ 31);break;  case  3:printf("第%d天\n",c+ 60);break;  case  4:printf("第%d天\n",c+ 91);break;  case  5:printf("第%d天\n",c+121);break;  case  6:printf("第%d天\n",c+152);break;  case  7:printf("第%d天\n",c+182);break;  case  8:printf("第%d天\n",c+213);break;  case  9:printf("第%d天\n",c+244);break;  case 10:printf("第%d天\n",c+274);break;  case 11:printf("第%d天\n",c+305);break;  case 12:printf("第%d天\n",c+335);break; }

user: user-1
content: if ((a%4==0 && a%100!=0) || a%400==0) {  printf("这是闰年%d年的",a); } else {  printf("这是平年%d年的",a); } switch(b) {  case  1:printf("第%d天\n",a,c    );break;  case  2:printf("第%d天\n",a,c+ 31);break;  case  3:printf("第%d天\n",a,c+ 60);break;  case  4:printf("第%d天\n",a,c+ 91);break;  case  5:printf("第%d天\n",a,c+121);break;  case  6:printf("第%d天\n",a,c+152);break;  case  7:printf("第%d天\n",a,c+182);break;  case  8:printf("第%d天\n",a,c+213);break;  case  9:printf("第%d天\n",a,c+244);break;  case 10:printf("第%d天\n",a,c+274);break;  case 11:printf("第%d天\n",a,c+305);break;  case 12:printf("第%d天\n",a,c+335);break; }

user: user-2
content: 引用 2 楼 changyuanchn 的回复:switch语句就不应该是这样用的。switch里面套用if，这个貌似没有这么用的吧 +1，没见过这么用的，这样有错误

user: user-3
content: int CalculateAbsoluteDays (int year, char month, char day) { 	/* 实现功能 */ 	int LeapYear; 	if((year>0)&&((month>=1)&&(month<=12))) 	{ 		if(((year%4==0)&&(year%100 !=0))||(year%400==0)) 			LeapYear = 1; 		else 			LeapYear = 0; 		if((day>=1)&&(day<=31)) 		{ 			if((month==2)&&(LeapYear==1)&&(day>29)) 				return 0; 			if((month==2)&&(LeapYear==0)&&(day>28)) 				return 0; 			if(((month==4)||(month==6)||(month==9)||(month==11))&&(day>30)) 				return 0; 			int MonArr[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; 			int i; 			int ActualDay = 0; 			for(i=0;i<(month-1);i++) 			{ 				ActualDay = ActualDay + MonArr[i]; 			} 			ActualDay = ActualDay+(day-0); 			return ((LeapYear==1)?(ActualDay+1):(ActualDay)); 		} 		else 			return 0; 	} 	else 		return 0; }

user: user-3
content: switch语句就不应该是这样用的。switch里面套用if，这个貌似没有这么用的吧

user: user-4
content: f((a%4==0 && a%100!=0) || a%400==0)前面应该加case : else前面应该加case :