#include<stdio.h>
typedef struct
{
int year;
int month;
int day;
}DATE;
int countday(DATE today);
int runyear(int year);
int main()
{
DATE today;
int totalday;
int result;
printf("please input 指定日期 包括年,月,日,如:1999 1 31\n");
scanf("%d%d%d",&today.year,&today.month,&today.day);
totalday=countday(today);
result=totalday%5;
if(result>0&&result<4)
printf("今天打鱼\n");
else
printf("今天晒网\n");
return 0;
}
int runyear(int year)
{
if((year%4==0&&year%100!=0)||(year%400==0))
return 1;
else
return 0;
}
int countday(DATE today)
{
int permonth[13]={0,31,28,31,30,31,30,31,31,30,31,30};
int totalday=0,year,i;
for(year=1990;year<today.year;year++)
{
if(runyear(year))
totalday+=366;
else
totalday+=365;
}
if(runyear(today.year))
permonth[2]+=1;
for(i=0;i<today.month;i++)
totalday+=permonth[i];
totalday+=today.day;
return totalday;
}