Академический Документы
Профессиональный Документы
Культура Документы
Код (2-1-3)
temp = 1;
for i=1:5
for j = 1:(i+1)
y(temp,1) = a(j,1);
y(temp,2) = a(i+1,1)-y(temp,1);
temp = temp + 1;
end;
end
temp = 1;
for i=1:20
if y(i,1) == 0 then
temp = temp + 1;
end;
for j=1:6
if x(j,5) == y(i,1) then
y(i,3) = x(j,6)
end;
if a(j,1) == y(i,2) then
y(i,4) = a(j,2)
end;
if a(j,1) == y(i,1) then
y(i,6) = a(j,4)
end;
end;
y(i,5) = y(i,3) + y(i,4)
if y(i,5) > x(temp,4) then
x(temp,4) = y(i,5);
x(temp,3) = y(i,1);
end;
end
temp = 1;
for i=1:20
if y(i,1) == 0 then
temp = temp + 1;
end;
for j=1:6
if a(j,1) == y(i,2) then
y(i,7) = x(j,4)
end;
end;
y(i,8) = y(i,6)+y(i,7)
if y(i,8) > x(temp,2) then
x(temp,2) = y(i,8);
x(temp,1) = y(i,1);
end;
end
for i=1:6
if x(i,5) == temp then
temp_id = i
end;
end
temp = temp - x(temp_id,3);
disp("В проект 3")
disp(x(temp_id,5))
disp(x)
disp(y)