void count_date(int large_year, int large_month, int large_day,
int small_year, int small_month, int small_day)
{
int count = 0;
int temp = 0;
for(; small_year < large_year ; small_year++)
{
if(( ( ((small_year) % 4) == 0) && (((small_year ) % 100) !=0) ) || (((small_year ) % 400) == 0))
{
count += 366;
}
else
{
count += 365;
}
}
if(((((small_year) % 4) == 0) && (((small_year) % 100) !=0)) || (((small_year) % 400) == 0))
{
temp = count_day(small_month, small_day)+1;
count -= temp;
}
else
{
temp = count_day(small_month, small_day);
count -= temp;
}
if(((((large_year) % 4) == 0) && (((large_year) % 100) !=0)) || (((large_year) % 400) == 0))
{
temp = count_day(large_month, large_day)+1;
count += temp;
}
else
{
temp = count_day(large_month, large_day);
count += temp;
}
printf("The count of day is %d\n", count);
}
阅读(747) | 评论(0) | 转发(0) |