标题:怎么会有一推错误
取消只看楼主
yynn
Rank: 1
等 级:新手上路
帖 子:279
专家分:0
注 册:2005-11-4
 问题点数:0 回复次数:0 
怎么会有一推错误
#include<graphics.h>
Void MidpointLine(x0,y0,x1,y1,color)
int x0,x1,y0,y1,color;
{intx,y,mid,dx,dy,d_up,d_down;
dy=y1-y0;dx=x1-x0;
mid=dx-2*dy;
d_up=2*dx-2*dy;d_down=-2*dy;
x=x0;y=y0;
while(x<=x1)
{putpixel(x,y,color);
x++;
if(mid<0){y++;mid=mid+d_up;}
else mid=mid+d_down;
}
}
main()
{int gb=DETECT,gm;
initgrph(&gd,&gm," ");
MidpointLine(100,100,300,200,14);
getch();
closegraph();
}
cfree通不过
搜索更多相关主题的帖子: include color 
2007-03-27 22:35



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-127321-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.115560 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved