|
发表于 2015-4-21 23:01:20
|
显示全部楼层
本帖最后由 panxixue 于 2015-4-22 00:28 编辑
占座先马上补作业回来
第一个作业:
axlCmdRegister("cBox" 'cBox)
defun(
cBox ( )
selBox = axlEnterBox();
x0=car(car(selBox));
y0=cadr(car(selBox));
x1=car(cadr(selBox));
y1=cadr(cadr(selBox));
minx=min(x0,x1);
maxx=max(x0,x1);
miny=min(y0,y1);
maxy=max(y0,y1);
printf("coordinates of left down point: (%f %f)\n",minx,miny);
printf("coordinates of right up point: (%f %f )\n",maxx,maxy);
);end defun
第二个作业
axlCmdRegister("letprog" 'letprog)
defun(
letfunc (a b )
let( (c)
c=max(a,b);
)
);end defun
defun(
progfunc (a b )
prog(( d )
d=max(a,b)
if(a>b
then
return(d);
else
d++;
)
)
);end defun
|
|