Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Department-numbers/Maple/department-numbers.maple
Normal file
23
Task/Department-numbers/Maple/department-numbers.maple
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#determines if i, j, k are exclusive numbers
|
||||
exclusive_numbers := proc(i, j, k)
|
||||
if (i = j) or (i = k) or (j = k) then
|
||||
return false;
|
||||
end if;
|
||||
return true;
|
||||
end proc;
|
||||
|
||||
#outputs all possible combinations of numbers that statisfy given conditions
|
||||
department_numbers := proc()
|
||||
local i, j, k;
|
||||
printf("Police Sanitation Fire\n");
|
||||
for i to 7 do
|
||||
for j to 7 do
|
||||
k := 12 - i - j;
|
||||
if (k <= 7) and (k >= 1) and (i mod 2 = 0) and exclusive_numbers(i,j,k) then
|
||||
printf("%d %d %d\n", i, j, k);
|
||||
end if;
|
||||
end do;
|
||||
end do;
|
||||
end proc;
|
||||
|
||||
department_numbers();
|
||||
Loading…
Add table
Add a link
Reference in a new issue