雷达

#include <graphics.h>
#include <math.h>
#include <conio.h>
#include <time.h>
int main() {
    initgraph(640, 480);
    int n=9;
    srand(time(0));
    double start=0;
    ExMessage m;
    int x=320,y=240;
    while(1){
    	while (peekmessage(&m)) {
            if(m.message==WM_KEYDOWN){
	    		switch(m.vkcode) {
	                case VK_LEFT:  x -= 10; break;
	                case VK_RIGHT: x += 10; break;
	                case VK_UP:    y -= 10; break;
	                case VK_DOWN:  y += 10; break;
	            }
			}
        }
    	fillcircle(x, y,25);
		pie(x-100, y-100, x+100, y+100,start,start+1);
		start+=0.1;
	    Sleep(50);
	    cleardevice();
    }
    getch();
    closegraph();
    return 0;
}

  

posted @ 2025-05-03 09:22  陈若麟  阅读(7)  评论(0)    收藏  举报