Re: Посмотрите задачу на С++
Добавлено: 04 мар 2008, 15:54
Тьфу... ты! Я еще от Паскаля не отошел)))!
А... за задержку большое спасибо!!!
А... за задержку большое спасибо!!!
Справка из встроенного Help-а:Anton_XXX писал(а):И еще...: В С++ есть очистка экрана... clrscr(); - так, да? А какую библиотеку надо всключить для очистки экрана тоже скажите...! Пожалуйста!)
Код: Выделить всё
▄▄▄▄▄▄▄▄
▌clrscr [b]<CONIO.H>[/b]
========
Clears text mode window
Declaration: void clrscr(void);
Remarks:
clrscr clears the current text window and places the cursor in the upper
left-hand corner (at position 1,1).
Return Value: None
Открываем встроенный help, например ту же справку на clrscr, тем (используя клавишу <TAB>) перемещаемся по "гиперссылкам". Встаем на <CONIO.H>, жмем ENTER, видим список функций. Нежно смотрим на список (названия худо-бедно за себя говорящие) функций, взгляд останавливается на textattr, textbackground, textcolor. Далее читаем по ним уже подробную справку:Anton_XXX писал(а):А как цвет текста изменить?
Код: Выделить всё
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▌textattr, textbackground, textcolor
===================================
■ textattr sets text attributes for text-window functions
■ textbackground selects a new text background color
■ textcolor selects a new character color in text mode
Declaration:
■ void textattr(int newattr);
■ void textbackground(int newcolor);
■ void textcolor(int newcolor);
Remarks:
These functions work for functions that produce text-mode output directly to
the screen (console output functions).
■ textattr sets both the foreground and background colors in a single call.
(Normally, you set the attributes with textcolor and textbackground.)
■ textbackground selects the background color.
■ textcolor selects the foreground character color.
These functions do not affect any characters currently on the screen. Once
you have called one of these three functions, all subsequent functions using
direct video output (such as cprintf) will use the new attributes or colors.
If you use symbolic color constants, the following limitations apply to the
background colors you select:
■ You can only select one of the first eight colors (0--7).
■ With textattr, you must shift the selected background color left by
4 bits to move it into the correct "bbb" bit positions.
■ NOTE: If you use the symbolic color constants, you must include CONIO.H.