3
21/10/2024 1:18 pm
Topic starter
Write a program that reads sequence of numbers, reverses their digits, and prints their sum.
Examples:
1 Answer
2
21/10/2024 1:19 pm
My solution:
<?php $arr = explode(" ", readline()); for ($i = 0; $i < count($arr); $i++) { $arr[$i] = strrev($arr[$i]); } echo array_sum($arr);