为什么输出一直是9,有大佬解决一下循环空运行的问题么
#include <stdio.h>
int main()
{
int year = 2008;
int mouth = 8;
int day = 8;
int i=1;
int j;
for(i=12;i>=mouth;i--)
{
switch(i)
{
case1:
break;
case2:j=j+31;
break;
case3:j=j+28;
break;
case4:j=j+31;
break;
case5:j=j+30;
break;
case6:j=j+31;
break;
case7:j=j+30;
break;
case8:j=j+31;
break;
case9:j=j+31;
break;
}
}
if(year%400==0||year%4==0||year%100==0&&mouth>2)
{
day=day+1+j;
printf("%d",day);
}
else
{
day=day+j;
printf("%d",day);
}
return 0;
}