《直线逐点比较法C程序》由会员分享,可在线阅读,更多相关《直线逐点比较法C程序(3页珍藏版)》请在金锄头文库上搜索。
1、 #include conio.h#include graphics.hvoid init_graph();void close_graph();static float x0,y0;void line_cabu(), draw_line(),draw_line_cabu();void line_cabu() int i;init_graph();sleep(1);for(i=0;i=0)Xm=Xm+step;elseYm=Ym+step;lineto(Xm,Ym);gotoxy(55,8); printf(X%3.0f Y0 Z%3.0f,Xm-100,Ym-120);delay(1100)
2、;void init_graph() int gdrive=DETECT,gmode;initgraph(cleardevice();void acrroods() x0=getmaxx()/2;y0=getmaxy()/2;main()int choice=0;init_graph();while(choice!=2)setfillstyle(1,RED);setcolor(GREEN);settextstyle(3,0,9);outtextxy(20,50,YUXIANG);setcolor(WHITE);settextstyle(0,0,1);outtextxy(200,150,1. Line demo.);outtextxy(200,170,2. Quit the program.);outtextxy(160,200,Please enter your choice:); gotoxy(46,13);scanf(%d,switch(choice) case 1: line_cabu();break;case 2: break;default: printf(nChoice wrong,try again!);