编写一个程序,提示用户输入一个年份以及这一年中第一天是星期几,
然后,输出每个月的第一天是星期几。
#include <iostream>
using namespace std;
int main()
{
cout << "Enter a year: ";
int year;
cin >> year;
cout << "Enter the first day of the year: ";
int firstDay;
cin >> firstDay;
int numberOfDaysInMonth = 0;
// Display calendar for each month
for (int month = 1; month <= 12; month++)
{
// Display Calendar title
switch (month)
{
case 1:
cout << "January 1, " << year << " is ";
numberOfDaysInMonth = 31;
break;
case 2:
&nbs