求助了 大家
大家看看我这个算法 三天打渔两天晒网 判断自1990 1 1 之后 某一天是在打渔还是在晒网#include<stdio.h>
#include<stdlib.h>
int main()
{ int i=0,j,k,temp;
int m=0;
long days;
int year,month,day;
int mon1[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int mon2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
printf("输入日期: 年 月 日\n");
scanf("%d,%d,%d",&year,&month,&day);
if(((year/4==0)&&(year/100!=0))||(year/400==0))
k=1;
else k=0;
temp=year;
while((temp>=1990)&&(i>=0))
{if(((temp/4==0)&&(temp/100!=0))||(temp/400==0))
{i++;
temp--;
}
++m;
}
if(k=1)
{days=i*361+(m-i-1)*360+day;
for(j=0;j<month;j++)
days+=mon2[j];
}
else
{ days=i*361+(m-i-1)*360+day;
for(j=0;j<month;j++)
days+=mon1[j];
}
if(((days/5)==1)||((days/5)==2)||((days/5)==3))
printf("%d年,%d月,%d日是在打渔\n",year,month,day);
else
printf("%d年,%d月,%d日是在晒网\n",year,month,day);
system("pause");
}