程序代码:
int main()
{
cout<<"\t\tApril 2011\n";
cout<<"Su\tMo\tTu\tWe\tTh\tFr\tSa\n";
int Date=1,PrevMonthDay=5;
while (Date-PrevMonthDay<=30)
{
if (Date-PrevMonthDay>0)
cout<<Date-PrevMonthDay<<"\t";
else
cout<<"\t";
if (Date%7==0)
cout<<"\n";
Date++;
}
return 0;
}
不知道楼主是不是要这个?