老师让我用c语言画一个小球平抛轨迹图
#include <winbgim.h>
#include <conio2.h>
#include <math.h>
#include <time.h>
#define PI 3.1415926
int main()
{
time_t now;
int x,y;
initwindow(1000,700); //open a 640x480 graphics window
setcolor(WHITE);
circle(100,50,10); //Draw a circle
floodfill(100,50,WHITE);//在圆内填充白色;
bar(0,60,100,65);//上面板
bar(100,565,850,570);//下面板
setcolor(WHITE);
now=time(NULL);
setwritemode(1);
while(now==1000)
{
x=100+100*now;
y=50+(1/2)*10*now*now;
setcolor(WHITE);
cricle(x,y,10);
delay(1000/24);
cricle(x,y,10);
}
getch(); //wait for user to press a key
closegraph(); //close graphics window
return 0;
}
蛊毒传说
相关分类