SHARE
TWEET

Untitled

a guest May 24th, 2019 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $inputNumbers = array_map('intval',explode(', ',readline()));
  3. $rows = $inputNumbers[0];
  4. $cols = $inputNumbers[1];
  5. $sum = 0;
  6. for ($row = 0; $row < $rows; $row++){
  7.     $arr = array_map('intval',explode(', ',readline()));
  8.         $sum += array_sum($arr);
  9. }
  10. echo $rows . PHP_EOL;
  11. echo $cols . PHP_EOL;
  12. echo $sum . PHP_EOL;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top