0
Who can make sum of two hundred integers ?
1895 contans 4 integers but i want 200
5 odpowiedzi
0
<?php
$start=0;
while ($start < 200)
{
$random=rand(1,9);
$array[]=$random;
$start++;
}
echo "<pre>";
print_r($array);
echo "</pre>";
?>
0
hey i meant sum of two hundred digits
1895+2343=xxxx is sum of two 4 digits and i want two hundred digit sum
0
hmmm ... u mean 100digits + 100digits=sum? ... and if so ... whats the problem?
0
yeah
i want u to write its algorithm
0
<?php
$start=0;
while($start<=99)
{
$array_1[]=rand(1,9);
$array_2[]=rand(1,9);
$start++;
}
$digit=array(implode($array_1),implode($array_2));
echo "digit 1: " . $digit[0] . "<br/>";
echo "digit 2: " . $digit[1] . "<br/>";
echo "sum: " . number_format(array_sum($digit));
?>