www.pudn.com > c.rar > ZY1.C, change:1997-07-16,size:645b


#include "graphics.h" 
#include "math.h" 
#include "stdlib.h" 
main() 
{ 
int driver=DETECT,mode=2; 
float i; 
float y; 
initgraph(&driver,&mode,"c:\\tc"); 
clrscr(); 
setbkcolor(BLUE); 
setcolor(RED); 
line(100,300,600,300); 
line(100,300,100,20); 
line(600,300,590,297);/**arrow**/ 
line(600,300,590,303); 
line(100,20,103,30); 
line(100,20,97,30);/**arrow**/ 
outtextxy(85,20,"Y"); 
outtextxy(605,305,"X"); 
moveto(100,300); 
for(i=100.0;i<=630.0;i+=1) 
{ 
y=300-100*sin((i-100)*3.1415926/180.0); 
if(y>0) 
{ 
{lineto(i,y); 
moveto(i,y); 
delay(0);} 
}} 
for(;;) 
{if(kbhit()) 
if (getch()==27) 
break; 
} 
cleardevice(); 
closegraph(); 
}