亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

這是我的代碼,可就是不知道怎么改,求大神幫忙!

這是我的代碼,可就是不知道怎么改,求大神幫忙!

C
慕容708150 2023-04-22 23:19:23
老師讓我用c語言畫一個小球平拋軌跡圖#include <winbgim.h>#include <conio2.h>#include <math.h>#include <time.h>#define PI 3.1415926int main(){time_t now;int x,y;initwindow(1000,700); //open a 640x480 graphics windowsetcolor(WHITE); circle(100,50,10); //Draw a circlefloodfill(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 keyclosegraph(); //close graphics windowreturn 0;}
查看完整描述

1 回答

?
蠱毒傳說

TA貢獻1895條經驗 獲得超3個贊

circle函數是TURBO C提供的圖形接口,用來畫圓。不屬于標準庫函數,不具備可移植性。
函數名:circle
功 能: 在給定半徑以(x, y)為圓心畫圓
用 法:void far circle(int x, int y, int radius)

隨時間變化,可以用cleardevice函數清除屏幕,不斷畫半徑不同的圓??雌饋砭拖袷且粋€隨時間變化的圓形。

函數名: cleardevice
功 能: 清除圖形屏幕
用 法: void far cleardevice(void);
例程:

#include <graphics.h>#include <stdlib.h>#include <stdio.h>#include <conio.h>int main(void){/* request auto detection */int gdriver = DETECT, gmode, errorcode;int midx, midy;int radius = 100;/* initialize graphics and local variables */initgraph(&gdriver, &gmode, "");/* read result of initialization */errorcode = graphresult();if (errorcode != grOk) /* an error occurred */{printf("Graphics error: %s\n", grapherrormsg(errorcode));printf("Press any key to halt:");getch();exit(1); /* terminate with an error code */}midx = getmaxx() / 2;midy = getmaxy() / 2;setcolor(getmaxcolor());for(i=0;i<1000000;i++) if(i%50000==0){    cleardevice();/* clean the screen */    circle(midx, midy, radius--);/* draw the circle */}getch();closegraph();return 0;}
查看完整回答
反對 回復 2023-04-26
  • 1 回答
  • 0 關注
  • 206 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號