搜索内容 搜索用户

# 10 麦片

050

2主题 0最佳答案

 l=zeros(1,26)w=zeros(1,26)l(1)=865l(2)=857l(3)=804l(4)=857l(5)=857l(6)=804l(7)=804l(8)=804l(9)=804l(10)=804l(11)=804l(12)=804l(13)=804l(14)=865l(15)=762l(16)=715l(17)=680l(18)=675l(19)=667l(20)=655l(21)=647l(22)=667l(23)=580l(24)=552l(25)=551l(26)=527w(1)=857w(2)=715w(3)=746w(4)=675w(5)=665w(6)=663w(7)=661w(8)=639w(9)=631w(10)=563w(11)=536w(12)=535w(13)=551w(14)=446w(15)=446w(16)=446w(17)=446w(18)=446w(19)=446w(20)=446w(21)=446w(22)=426w(23)=446w(24)=446w(25)=446w(26)=426zhang=0n=zeros(26,1)n(1)=98n(2)=98n(3)=196n(4)=28n(5)=28n(6)=224n(7)=308n(8)=84n(9)=56n(10)=224n(11)=196n(12)=392n(13)=392n(14)=98n(15)=196n(16)=98n(17)=224n(18)=28n(19)=28n(20)=84n(21)=56n(22)=308n(23)=224n(24)=196n(25)=26n(26)=392zhang1=0s1=0s2=0s3=0s4=0temp2=0kk=0for j=1:26m=2100-l(i)*fix(2100/l(j))e=1650-w(j)*fix(1650/w(j))while n(j)>0n(j)=n(j)-fix(2100/l(j))*fix(1650/w(j))zhang=zhang+1kk=0for i=j:26if(e>w(i)&&n(i)>fix(e/l(i))*fix(2100/w(i))&&n(i)>fix(e/w(i))*fix(2100/l(i))&&n(i)>0)if(w(i)*l(i)>s1)s1=w(i)*l(i)temp1=ikk=1endendif(m>w(i)&&n(i)>fix(m/l(i))*fix(1650-e/w(i))&&n(i)>fix(m/w(i))*fix(1650/l(i))&&n(i)>0)if(w(i)*l(i)>s2)s2=w(i)*l(i)temp2=ikk=1endendends1=0s2=0if kk~=0if(temp1~=0)i=temp1n(i)=n(i)-max(fix(e/l(i))*fix(2100/w(i)),fix(e/w(i))*fix(2100/l(i)))endif(temp2~=0)n(temp2)=n(temp2)-max(fix(m/l(temp2))*fix(1650-e/w(temp2)),fix(m/w(temp2))*fix(1650-e/l(temp2)))endendendend

# 526 麦片

5001500

1主题 98最佳答案
• 关注者： 7

 第91行改为m=2100-l(j)*fix(2100/l(j))

# 10 麦片

050

2主题 0最佳答案
楼主| 发表于 2020-7-4 18:17:49 | 显示全部楼层
 帕拉代斯 发表于 2020-7-4 18:14 第91行改为m=2100-l(j)*fix(2100/l(j)) 已找到原因，还是谢谢了！

 您需要登录后才可以回帖 登录 | 注册 本版积分规则 回帖后跳转到最后一页