我的为什么不对?哪里错了
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int n,i,day=9,month=11,year=2014;
printf("输入相隔天数:");
scanf("%d",&n);
for(i=1;i<=n+1;i++)
{
if((year%4==0&&year%100!=0)||year%400==0)
{
if(month==2)
{
if(day<29)
day++;
else if(day==29)
day=1;
month++;
}
else if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
{
if(day<31)
day++;
else if(day==31)
day=1;
month++;
}
else if(month==4||month==6||month==9||month==11)
{
if(day<30)
day++;
else if(day==30)
day=1;
month++;
}
else if(month==13)
{
month=1;
day++;
year++;
}
}
else
{
if(month==2)
{
if(day<28)
day++;
else if(day==28)
day=1;
month++;
}
else if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
{
if(day<31)
day++;
else if(day==31)
day=1;
month++;
}
else if(month==4||month==6||month==9||month==11)
{
if(day<30)
day++;
else if(day==30)
day=1;
month++;
}
else if(month==13)
{
month=1;
year++;
}
}
}
printf("%d-%d-%d",year,month,day);
return 0;
}