//学习gotoxy()与clrscr()函数
//程序分析
//程序源代码
#include <conio.h>
void main()
{
clrscr();/*清屏函数*/
textbackground(2);
gotoxy(1,5);/*定位函数*/
cprintf("Output at raw 5 column 1\n");
textbackground(3);
gotoxy(20,10);
cprintf("Output at raw 10 column 20\n");
return 0;
}
//程序分析
//程序源代码
#include <conio.h>
void main()
{
clrscr();/*清屏函数*/
textbackground(2);
gotoxy(1,5);/*定位函数*/
cprintf("Output at raw 5 column 1\n");
textbackground(3);
gotoxy(20,10);
cprintf("Output at raw 10 column 20\n");
return 0;
}
本文介绍如何在C语言中使用gotoxy()与clrscr()函数来控制文本输出的位置和清屏操作。通过示例代码展示了如何设置背景颜色、定位输出位置以及清除屏幕。
672

被折叠的 条评论
为什么被折叠?



