You are viewing a single comment's thread. Return to all comments →
i did the same in php
function plusMinus($arr) { $pos = 0; $neg = 0; $zero = 0; foreach (`$arr as $`key => $value) { if ($value > 0) { $pos++; } if ($value < 0) { $neg++; } if ($value === 0) { $zero++; } } echo `$pos / sizeof($`arr) . PHP_EOL; echo `$neg / sizeof($`arr) . PHP_EOL; echo `$zero / sizeof($`arr) . PHP_EOL;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
i did the same in php
}