求C语言程序设计 大一知识的 不少于300行 哪位强人帮个忙 考试要挂啦!!!1

来源:百度知道 编辑:UC知道 时间:2024/05/27 17:07:16
越简单越好
但一定不少于300句
要有解释
急啊
小妹在这先谢过了

一箭穿心代码
#include<graphics.h>
#include<math.h>

#define FNX(x1) (int)(x+(x1)*sl)
#define FNY(y1) (int)(MAXY-(y+(y1)*sl))
#define R(theta) 1-pow(cos(1*theta),1)

int sl=50,MAXY;
float x1,y1,xs,ys,r,theta;
/*画心*/
void draw(int x,int y)
{
for(theta=0;theta<2*3.14;theta+=0.01)
{r=R(theta);
x1=r*sin(theta);y1=r*cos(theta);
xs=FNX(x1);ys=FNY(y1);
if(theta==0)moveto(xs,ys);else lineto(xs,ys);
}
}

/*画箭头*/
void jian()
{
line(205,235,200,240);
line(200,240,205,245);
line(200,240,214,240);
line(400,240,500,240);
line(485,235,480,240);
line(480,240,485,245);
line(490,235,485,240);
line(485,240,490,245);
line(495,235,490,240);
line(490,240,495,245);
line(500,235,495,240);