打印优化的问题,很难哦,大侠们进来看看
yadg 2005-06-28 12:56:13 有5种固定大小的纸,A0(114900,84100),A1(84100,59400),A2(59400,42000),A3(42000,29700),A4(29700,21000),这时要打n张图,每张图大小都是A0-A4中的1种,打印机现在纸型为X(A0--A4),求要完全打印这些图需要最少用纸的算法(图纸还可以旋转,如A0的纸可以打印2张A1的图)。
函数设计如下:
type paper
x as double'纸张的宽
y as double'纸张的长
end type
type PrintPaper'要打印的图
id as string给每张要打印的图起个id
paperType as paper'要打印的类型
counts as double'要打印的份数
end type
type PrintPaper2'算出来的纸
id as string
x0,y0 as double'该图片插入的位置
rotate as boolean'是否旋转
end type
function getMinPaper(curPaper as paper,printPaper() as printPaper) as PrintPaper2()