题目:按任意键改变颜色
1.程序分析:按任意键改变颜色,设置文本的背景颜色
2.程序源代码:
#include <stdio.h>
#include <conio.h>
void main(void)
{
int color;
for (color = 0; color < 8; color++)
{
textbackground(color);/*设置文本的背景颜色*/
cprintf("This is color %d\r\n", color);
cprintf("Press any key to continue\r\n");
getch();/*输入字符看不见*/
}
}
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!