<?php
$acumulador = 0;
$numero = 0;
for ($i = 0; $numero >= 0; $i++) {
$numero = (int) trim(fgets(STDIN));
if ($numero <0) {
break;
}
$acumulador += $numero;
}
printf("%.1f", $acumulador/$i);
?>
To embed this project on your website, copy the following code and paste it into your website's HTML: