Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void print_calendar(const date &d, const POTOM_NAZOVU_NORMALNO& di)
- {
- CONSOLE_SCREEN_BUFFER_INFO inf;
- HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- GetConsoleScreenBufferInfo(hConsole, &inf);
- unsigned short prev = inf.wAttributes;
- unsigned short red = 4;
- int wd = weekday(d);
- cout << " П В С Ч П С В" << endl << endl;
- whitespace(wd * 3);
- for(int i = 1; i <= days_in_month(d.month(), d.year()); i++)
- {
- if(di.check(date(i, d.month(), d.year())))
- {
- SetConsoleTextAttribute(hConsole, red);
- cout << setw(2) << i;
- SetConsoleTextAttribute(hConsole, prev);
- }
- else
- cout << setw(2) << i;
- cout << " ";
- wd = (wd + 1) % 7;
- if(wd == 0)
- cout << endl;
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement