Write a program that takes 3 lines of characters and prints them in reversed order with a space between them.
Examples:
Mine is with strrev string function (line #8):
<?php $chars = ''; for ($i = 0; $i < 3; $i++) { $chars .= readline()." "; } echo strrev($chars);
My solution:
<?php $input1 = readline(); $input2 = readline(); $input3 = readline(); echo "$input3 $input2 $input1";
Mine:
<?php $chars = ''; for ($i = 0; $i < 3; $i++) { $chars .= readline(); } $output = ''; for ($i = 2; $i >= 0; $i--) { $output .= $chars[$i] . " "; } echo $output;
622 questions
979 answers
129 comments
53 users