c语言程序设计背景颜色

来源:百度知道 编辑:UC知道 时间:2024/06/05 01:00:34
给出一段范文就可以了
void view_main(); /**函数声明**/
void fun_lb();
void fun_px();
void fun_sxb();
void view_px();
void view_sxb();
void view_lb();
void textcolor(int color);
/**********主函数**********/
void textbackground(int RED);
main()
{
int i;
view_main();
gotoxy(42,15);
printf(" ");
gotoxy(42,15);
scanf("%d",&i);
while(1)
{
if(i==1)
{
view_px();
fun_px();
} /*通过i来选择相应的界面与相应的函数*/
else if(i==2)
{
view_sxb();
fun_sxb();
}
else if(i==3)
{
view_lb();
fun_lb();
}
else if(i==0) break;
else
{gotoxy(42,16);
printf(&qu

函数名: textcolor
功 能: 在文本模式中选择新的字符颜色
用 法: void textcolor(int color);
程序例:
#include <conio.h>
int main(void)
{
int i;
for (i=0; i<15; i++)
{
textcolor(i);
cprintf("Foreground Color\r\n");
}
return 0;
}

函数名: textbackground
功 能: 选择新的文本背景颜色
用 法: void textbackground(int color);
程序例:
#include <conio.h>
int main(void)
{
int i, j;
clrscr();
for (i=0; i<9; i++)
{
for (j=0; j<80; j++)
cprintf("C");
cprintf("\r\n");
textcolor(i+1);
textbackground(i);
}
return 0;
}