#include
bool IsLeapyear(int year)
{
if(year%4==0 &&year0!=0 || year @0==0)
{
return true;
}
return false;
}
bool IsThirty(int month)
{
if(month==4 ||month==6 ||month==9 ||month==11)
{
return true;
}
return false;
}
int Today(int year,int month,int day)
{
int daycount=0;
if(month>=2)
{
if(IsLeapyear(year))
{
for(int i=1;i
{
if(i==2)
{
daycount=daycount+29;
}
else
{
if(IsThirty(month))
{
daycount+=30;
}
else
{
daycount+=31;
}
}
}
daycount=daycount+day;
return daycount;
}
else
{
for(int i=1;i
{
if(i==2)
{
daycount=daycount+28;
}
else
{
if(IsThirty(month))
{
daycount+=30;
}
else
{
daycount+=31;
}
}
}
daycount=daycount+day;
return daycount;
}
}
return day;
}
int main()
{
printf("%d\n",Today(2016,3,4));
}