计算日期公式(根据年月日算星期几)

# include 
# include 
using namespace std;

int CaculateWeekDay(int y, int m, int d)
{
	int week = -1;
	if(m == 1 || m == 2)
	{
	m += 12;
	y--;
	}
		

	week = (d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7;

	return week;
}

int main()
{
	cout<

你可能感兴趣的:(水)