2009年9月全国计算机等级考试二级C语言程序设计题(32)
来源:优易学  2011-7-30 16:15:15   【优易学:中国教育考试门户网】   资料下载   IT书店
题目:Press any key to change color, do you want to try it. Please hurry up!
  1.程序分析:
  2.程序源代码:
  #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();/*输入字符看不见*/
  }
  }

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训