求高手赐教。用c++做四月份的日历
小弟新手入门,求各位大侠的帮助。用c++做4月份的日历。 求讲解。
April 2011 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
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; }不知道楼主是不是要这个?