该楼层疑似违规已被系统折叠隐藏此楼查看此楼
这周程序设计啊,我这有个例子,哪位大哥给改改也行啊
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define PAI 3.1415926
#define LEFT1 480
#define TOP 320
#define RIGHT1 639
#define BOTTOM 479
#define LINES 700
#define MAXCOLOR 256
#define SPEED 10
main()
{
struct time t;
int i,j,k,x,y,x0,y0;
int sx1,sy1,sx2,sy2;
int dx1,dy1,dx2,dy2;
int count=0;
int color=0;
int driver,mode;
int tb,tc,td,te,tf;
float a;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
x0=80;y0=395;
sx1=sx2=500;
sy1=sy2=353;
dx1=dy1=2;
dx2=dy2=3;
setcolor(15);
gettime(&t);
tb=t.ti_sec;
tc=0;
setcolor(9);
line(160,40,480,40);
line(160,40,160,280);
line(160,280,480,280);
line(480,40,480,280);
for (k=0;k<=5000;k++)
{
while(kbhit())
{
restorecrtmode();
return;
}
for(i=0;i<=16;i++)
{
setcolor(color);
line(sx1,sy1,sx2,sy2);
sx1+=dx1;sy1+=dy1;
sx2+=dx2;sy2+=dy2;
gettime(&t);
if(t.ti_sec==(tb+5*tc)%60)
{