#include<iostream> using namespace std; int main(){ int year,mouth,day,x=0,i; int a[12]={31,28,31,30,31,30,31,31,30,31,30,31}; scanf("%d%d%d",&year,&mouth,&day); if(year-1990<=2) x=(year-1990)*365+day; else x=365*2+((year-1-1992)/4+1)*366+(year-1992-((year-1-1992)/4+1))*365+day; if((year%4==0&&year%100!=0)||(year%400==0)) a[1]=29; for(i=0;i<mouth-1;i++) x=x+a[i]; if(x%5<=3&&x%5>0) printf("今天打鱼"); else printf("今天晒网"); printf("%d",x); return 0; }
首先先分为1992年之前和1992年之后两种情况,因为1992是第一个闰年从这里分开方便计算
标签:printf,1992,int,31,30,第三天,year,打卡 From: https://www.cnblogs.com/gjsgjs/p/17331294.html