vc6添加图形库可运行
1.[文件] heart1.cpp ~ 578B 下载(15)
#include
#include
#include
#include
int main ()
{
initgraph(360,360);
setbkcolor(LIGHTBLUE);
setcolor(GREEN);
cleardevice();
setorigin(180,180);
setaspectratio(1,-1);
line(-180,0,180,0);
line(0,-180,0,180);
line(180,0,175,3);line(180,0,175,-3);
line(0,180,-3,175);line(0,180,3,175);
//x^2+(y-x^(2/3))^2=1
for(double x=-180;x<=180;x++)
for(double y=-180;y<=180;y++)
{
double m=x/100,n=y/100;
if(m*m+pow(n-pow(m*m,1.0/3),2)<1) putpixel(x,y,RED);
}
getch();
closegraph();
return 0;
}
2.[文件] heart2.cpp ~ 582B 下载(8)
#include
#include
#include
#include
int main ()
{
initgraph(360,360);
setbkcolor(LIGHTBLUE);
setcolor(GREEN);
cleardevice();
setorigin(180,180);
setaspectratio(1,-1);
line(-180,0,180,0);
line(0,-180,0,180);
line(180,0,175,3);line(180,0,175,-3);
line(0,180,-3,175);line(0,180,3,175);
//(x^2+y^2-1)^3-(x^2)(y^3)=0
for(double x=-180;x<=180;x++)
for(double y=-180;y<=180;y++)
{
double m=x/100,n=y/100;
if(pow(m*m+n*n-1,3)-m*m*n*n*n<0) putpixel(x,y,RED);
}
getch();
closegraph();
return 0;
}