#include
int day_of_year(int year,int month, int day)
{
int monthDays[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int i;
for(i=0;iday+=monthDays[i];
if(year%4==0&&year%100!=0||year%400==0)
{
if (month >2)
day+=1;
}
return day;
}
int main()
{
int day;
day=day_of_year(2013,5,23);
printf("%d\n",day);
return 0;
}