Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
18
Task/Department-numbers/MATLAB/department-numbers.m
Normal file
18
Task/Department-numbers/MATLAB/department-numbers.m
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
% Execute the functions
|
||||
clear all;close all;clc;
|
||||
sol = findsolution();
|
||||
disp(table(sol(:, 1), sol(:, 2), sol(:, 3), 'VariableNames',{'Pol.','Fire','San.'}))
|
||||
|
||||
function sol = findsolution()
|
||||
rng = 1:7;
|
||||
sol = [];
|
||||
for p = rng
|
||||
for f = rng
|
||||
for s = rng
|
||||
if p ~= s && s ~= f && f ~= p && p + s + f == 12 && mod(p, 2) == 0
|
||||
sol = [sol; p s f];
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue