文本模式模仿磁盘扫描外观
2008-03-08 12:49:49 来源:WEB开发网核心提示:程序很简单,主要是把光标藏起来了,练习下文本模式下的作图.#include "conio.h"#include "stdlib.h" main(){int i,j; clrscr(); randomize(); textcolor(BLUE); textbackground(BL
程序很简单,主要是把光标藏起来了,练习下文本模式下的作图.
#include "conio.h"
#include "stdlib.h"
main()
{int i,j;
clrscr();
randomize();
textcolor(BLUE);
textbackground(BLUE);
for(i=1;i<=25;i++)
for(j=1;j<=80;j++)
{
gotoxy(j,i);
cPRintf(" ");
}
gotoxy(6,3);
textcolor(11);
cprintf("Microsoft Scan Disk");
gotoxy(6,5);
for(i=1;i<70;i++)
cprintf("%c",196);
gotoxy(6,7);
cprintf("Because Windows is not properly shut down,");
gotoxy(6,9);
cprintf("one or more if disk drives may have errors on it.");
gotoxy(6,19);
textcolor(7);
textbackground(12);
cprintf("%cExit%c",17,16);
textbackground(BLUE);
textcolor(11);
gotoxy(6,21);/*上半部分主要就是写写字改改颜色*/
for(i=0;i<70;i++)
cprintf("%c",196);
gotoxy(16,22);
textcolor(YELLOW);
for(i=0;i<60;i++)
cprintf("%c",176);
gotoxy(16,22);
for(i=0;i<60;i++)
{
textcolor(YELLOW);
gotoxy(i+16,22);
cprintf("%c",219);
textcolor(11);
gotoxy(6,22);
cprintf("%d%%",(i+1)*100/60);/*输出百分率*/
gotoxy(i+15,22);/*隐藏光标*/
j=random(5000)+4000;
delay(j);
}
getch();
}
#include "stdlib.h"
main()
{int i,j;
clrscr();
randomize();
textcolor(BLUE);
textbackground(BLUE);
for(i=1;i<=25;i++)
for(j=1;j<=80;j++)
{
gotoxy(j,i);
cPRintf(" ");
}
gotoxy(6,3);
textcolor(11);
cprintf("Microsoft Scan Disk");
gotoxy(6,5);
for(i=1;i<70;i++)
cprintf("%c",196);
gotoxy(6,7);
cprintf("Because Windows is not properly shut down,");
gotoxy(6,9);
cprintf("one or more if disk drives may have errors on it.");
gotoxy(6,19);
textcolor(7);
textbackground(12);
cprintf("%cExit%c",17,16);
textbackground(BLUE);
textcolor(11);
gotoxy(6,21);/*上半部分主要就是写写字改改颜色*/
for(i=0;i<70;i++)
cprintf("%c",196);
gotoxy(16,22);
textcolor(YELLOW);
for(i=0;i<60;i++)
cprintf("%c",176);
gotoxy(16,22);
for(i=0;i<60;i++)
{
textcolor(YELLOW);
gotoxy(i+16,22);
cprintf("%c",219);
textcolor(11);
gotoxy(6,22);
cprintf("%d%%",(i+1)*100/60);/*输出百分率*/
gotoxy(i+15,22);/*隐藏光标*/
j=random(5000)+4000;
delay(j);
}
getch();
}
[]
更多精彩
赞助商链接