#include <iostream>
#include <iomanip>
using namespace std;
int main(void)
{
int days,week;
cout << "Please input the days and week:" << endl;
cin >> days >> week;
if(days<28 || days>31) cout << "Error days!" << endl;
if(week<1 || week>7) cout << "Error week!" << endl;
cout << " MON TUE WED THU FRI SAT SUN" << endl;
cout << " ===========================" << endl;
for(int i=1; i<week; i++) cout << setw(4) << " ";
for(i=1; i<=days; i++)
{
cout << setw(4) << i;
if((i+week-1)%7==0) cout << endl;
}
cout << endl << " ===========================" << endl;
return 0;
}
网友评论