先水一篇。。。。。微困
zzz。。。
#include <bits/stdc++.h> using namespace std; int CalcWeekDay(int year, int month, int day){ if(month ==1 || month == 2){ month+=12; year--; } int ret = ((day+2*month+3*(month+1)/5+year+year/4-year/100+year/400)+1)%7; return (0 == ret) ? 7 : ret; } int main() { int a,b,c; cin>>a>>b>>c; cout<<CalcWeekDay(a,b,c); }