#include <iostream>
#include <cstring>
using namespace std;
int main()
20101214
{
int year1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; //
int year2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; //
int date;
int year, mouth, day;
cin >> date;
year = date / 10000;
st
mouth = date % 10000 / 100;
day = date % 100;
int soc = 2010;
int i = 0;
int sum = 0;
for (i = 0; soc < year; i++)
{
if (soc % 4 == 0 && soc % 100 != 0 || i % 400 == 0)
sum += 366;
else
sum += 365;
soc++;
}
if (soc % 4 == 0 && soc % 100 != 0 || i % 400 == 0)
{
for (int j = 0; j < mouth - 1; j++)
{
sum += year2[j];
}
}
else
{
for (int j = 0; j < mouth - 1; j++)
{
sum += year1[j];
}
}
sum = sum + day; //
if (sum % 5 == 4||sum % 5 ==0)
cout << "晒网";
else
cout << "打鱼";
return 0;
}
三天打鱼两天晒网(C++)
最新推荐文章于 2023-11-13 21:05:29 发布