其他分享
首页 > 其他分享> > 三天打鱼两天晒网

三天打鱼两天晒网

作者:互联网

余生@三天打鱼两天晒网

<stdio.h>

int main(){
int i,year,month,day,days;
int moth[13]={
0,31,28,31,30,31,30,31,31,30,31,30,31};

printf("请输入某年某月某日",year,month,day);
scanf("%d%d%d",&year,&month,&day);
if(year>2110)
printf("该渔夫活不到那一年请重新输入");
for(i=2010;i<year;i++)
{
	if(i%400==0||(i%4==0&&i%100!=0))
	days+=366;
	days+=365;
};
for(i=0;i<month;i++)
{
	days+=moth[i];
};
if(month>2&&year%400==0||(year%4==0&&year%100!=0))
days+=day+1;
days+=day;
printf("该渔夫从2010年1月1日到%d年%d月%d日共经历啦%d天\n",year,month,day,days);
if(days%5<4)
printf("%d年%d月%d日他在打鱼",year,month,day);
else
printf("%d年%d月%d日他在晒网",year,month,day);

}

``

标签:两天晒网,30,31,三天打鱼,days,month,year,day
来源: https://blog.csdn.net/qq_44271651/article/details/88069206