![]() |
#2
LC→雷2010-05-15 10:25
#include <stdio.h>
#include <graphics.h> #include <stdlib.h> #include <math.h> #include <time.h> #include<conio.h> void main() { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int i=0,j,k; int radius=6; int array[50]; /* initialize graphics, local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ } midx = getmaxx() / 2; midy = getmaxy() / 2; setcolor(RED); /* Create random numbers */ srand((unsigned)time(NULL)); printf("Create random numbers!\n"); for(j=0;j<=15;j++) { array[j]=rand()%41; printf("%d\n",array[j]); delay(90000); } for(k=0;k<=15;k++) { cleardevice(); for(;i<=40;i++) { circle(midx,midy,radius); radius=radius+6; } putpixel(midx+(array[k]+1)*6, midy, GREEN); delay(900000); } /* clean up */ getch(); closegraph(); } 这是程序的源代码,圆显示完了就没有了啊/我想让他在寻道时显示出来圆啊 |
只有本站会员才能查看附件,请 登录