代码:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int y,m,d;
while(scanf("%d%d%d",&y,&m,&d)!=EOF)
{
if(m<=2)//是1月或2月时,当做去年的13,14月处理
{
y--;
m+=12;
}
int ans = (d+1+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7;
if (ans==0)
printf("7\n");
else
printf("%d\n",ans);
}
return 0;
}
转载请注明原文地址: https://ju.6miu.com/read-660979.html