Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Department-numbers/PHP/department-numbers.php
Normal file
13
Task/Department-numbers/PHP/department-numbers.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
$valid = 0;
|
||||
for ($police = 2 ; $police <= 6 ; $police += 2) {
|
||||
for ($sanitation = 1 ; $sanitation <= 7 ; $sanitation++) {
|
||||
$fire = 12 - $police - $sanitation;
|
||||
if ((1 <= $fire) and ($fire <= 7) and ($police != $sanitation) and ($sanitation != $fire)) {
|
||||
echo 'Police: ', $police, ', Sanitation: ', $sanitation, ', Fire: ', $fire, PHP_EOL;
|
||||
$valid++;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo $valid, ' valid combinations found.', PHP_EOL;
|
||||
Loading…
Add table
Add a link
Reference in a new issue