亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        一個畫拋物線的程序

        字號:

        /*這是一個畫拋物線的程序*/
            #include
            #define BKC 9
            #define COLOR 8 /* 拋物線顏色*/
            #define G 9.856
            main()
            {int gd=DETECT,gm,p=1,i;
            double Vx,Vy,x,y,x1,y1,t;
            char ch;
            initgraph(&gd,&gm,"");
            while(p==1) /*主循環(huán)體*/
            {
            setbkcolor(BKC);
            setcolor(14);
            setlinestyle(0,0,1);
            rectangle(0,0,639,479); /*畫邊框*/
            line(20,460,639,460); /*畫橫坐標*/
            line(20,0,20,460); /*畫縱坐標*/
            outtextxy(8,467,"0");
            setlinestyle(1,0,1);
            setcolor(15);
            for(i=20;i<640;i+=20)line(i,460,i,0);
            for(i=460;i>0;i-=20)line(20,i,640,i);
            gotoxy(1,1);
            printf("Please Enter Vx:" );
            scanf("%lf",&Vx);
            printf("Please Enter Vy:");
            scanf("%lf",&Vy);
            for(t=0.0;;t+=0.00002)
            {
            x=Vx*t;
            y=Vy*t-0.5*G*t*t;
            x1=2*x+20; /*畫筆定位在用戶坐標原點 (20,460) */
            y1=460-y*2;
            if(y1>460.0||x1>640.0) break;
            putpixel(x1,y1,COLOR);
            }
            setcolor(12);
            outtextxy(250,8,"Finished! Continue(Y/N)?");
            p=-1;
            while(p==-1)
            {
            ch=getch();
            if(ch=='y'||ch=='Y') { cleardevice();p=1;}
            else if(ch=='n'||ch=='N') p=0;
            else outtextxy(220,200,"ERROR! Please Press 'Y' or 'N'_" );
            }
            }
            closegraph();
            }