求一C语言编程问题答案!!!急·!!!!
展开全部
void main()
{
int year,month;
int monthday, isRunNian=0;
char* jijie;
scanf("%d%d",&year,&month);
if((year%4==0 && year%100!=0)||(year%400==0))
{
printf("是闰年");
isRunNian=1;
}
else
printf("是平年");
switch(month)
{
case 1:monthday=31;jijie="winter";break;
case 2:if(isRunNian==0) monthday=28;
else monthday=29;
jijie="winter";
break;
case 3:monthday=31;jijie="spring";break;
case 4:/*省略后面几个月的*/
}
printf("%d月是%s,该月有%d天.\n",month,jijie,monthday);
}
{
int year,month;
int monthday, isRunNian=0;
char* jijie;
scanf("%d%d",&year,&month);
if((year%4==0 && year%100!=0)||(year%400==0))
{
printf("是闰年");
isRunNian=1;
}
else
printf("是平年");
switch(month)
{
case 1:monthday=31;jijie="winter";break;
case 2:if(isRunNian==0) monthday=28;
else monthday=29;
jijie="winter";
break;
case 3:monthday=31;jijie="spring";break;
case 4:/*省略后面几个月的*/
}
printf("%d月是%s,该月有%d天.\n",month,jijie,monthday);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询