你写的可以说完全不对而且最后的条件里面还有无用的条件 不知道你什么意思
大概这样改了一下
model:
sets:
train/1..7/:x,y,h,w,n;
endsets
data:
h=48.7,52.0,61.3,72.0,48.7,52.0,64.0;
w=2,3,1,0.5,4,2,1;
n=8,7,9,6,6,4,8;
enddata
max = @sum(train(i):h(i)*x(i)+h(i)*y(i));
@for(train:h*x<=302.7;
h*y<=302.7;
w*x<=40;
w*y<=40;);