您现在的位置: 天极网 > 开发频道 > C语言程序开发经典实例之四
全文

C语言程序开发经典实例之四

2004-06-17 09:36作者:不详出处:唯C世界责任编辑:方舟
 程序33】

  题目:学习gotoxy()与clrscr()函数   

  1.程序分析:
 
  2.程序源代码:

#include <conio.h>
void main(void)
{
 clrscr();/*清屏函数*/
 textbackground(2);
 gotoxy(1, 5);/*定位函数*/
 cprintf("Output at row 5 column 1\n");
 textbackground(3);
 gotoxy(20, 10);
 cprintf("Output at row 10 column 20\n");
}

  【程序34】

  题目:练习函数调用

  1. 程序分析:

  2.程序源代码:

#include <stdio.h>
void hello_world(void)
{
 printf("Hello, world!\n");
}
void three_hellos(void)
{
 int counter;
 for (counter = 1; counter <= 3; counter++)
  hello_world();/*调用此函数*/
}
void main(void)
{
 three_hellos();/*调用此函数*/
}

  【程序35】

  题目:文本颜色设置

  1.程序分析:

  2.程序源代码:

#include <conio.h>
void main(void)
{
 int color;
 for (color = 1; color < 16; color++)
 {
  textcolor(color);/*设置文本颜色*/
  cprintf("This is color %d\r\n", color);
 }
 textcolor(128 + 15);
 cprintf("This is blinking\r\n");
}

共4页。 9 1 2 3 4 :

软件资讯·软件下载尽在天极软件

相关搜索:
关注此文读者还看过
热门关注
特别推荐
网友关注
软件下载
娱乐下载
驱动下载
文章排行
本周
本月
最近更新
关于我们|About us|网站律师|天极服务|电子杂志|RSS订阅|加入我们|网站地图
TMG
Copyright (C) 1999-2009 Chinabyte.com, All Rights Reserved 版权所有 天极网络
商务联系、网站内容、合作建议:010-82657868
版权声明 在线提交意见反馈 渝ICP证B2-20030003号
经营性网站备案信息 网警备案 中国网站排名
天极传媒:天极网|比特网|IT专家网|IT商网|52PK游戏网|IT分众