Find all numbers within 2000 that are divisible by 7 and contain 7. Change a line every 10 characters
Display on the web page in the php environment
It would be better if you could give some comments
//More rigorous writing
$num=1;for ($i = 0; $i <= 2000; $i ) { if ($i != 0) { if ($ i % 7 == 0 || strstr($i, 7)) { echo $i.'--'; if ($num % 10 == 0) { echo "<br/>"; $num ; ????????????????????????????????}
//代碼少一點(diǎn)
for($i=0;$i<=2000;$i ){ ? ?if($i != 0){ ? ? ? ?if($i%7==0||strstr($i,7)){ ? ? ? ? ? ?echo $i.'-'; ? ? ? ? ? ?if($i==0){ ? ? ? ? ? ? ? ?echo "<br/>"; ? ? ? ? ? ?} ? ? ? ?} ? ?}}
It should look like this
} if($num>=10){\\If the number of output reaches 10 times or exceeds 10 times, break the line echo "<br/>"; $num=0;\\After newline, the output count is reset to 0 } }?>