<title> hundred money buy Hundred chicken </title>
<meta http-equiv= "Content-type" content= "Text/html;charset=utf-8"/>
<?php
/* Title: Rooster One, worth five, hen one, worth three, chicken three, worth one. Hundred money buys hundred chicken, asks the rooster, the hen, the chicken each geometry? */
$g: The number of cocks to buy
$m: The number of hens to buy
$x, number of chickens to buy
How many times $count =0;//statistics calculated
for ($g =0; $g <=100/5; $g + +)
{
for ($m =0; $m <33; $m + +)
{
$x =100-$g-$m;
if (5* $g +3* $m + $x/3==100 && $x%3==0)
{
echo "Can buy Rooster". $g. " Only "." can buy hens ". $m." Only "." can buy chickens ". $x." Only ";
}
$count + +;
}
echo "<br/>";
}
echo $count;//Number of calculations
?>
Note: The encoding of the file to be saved is consistent with the encoding of the setting, otherwise there will be garbled problems
Hundred dollars in PHP to buy hundred chickens