Copy code The code is as follows:
//Yang Hui Triangle
for ($i=6; $i >= 0;$i--)
{
for ($j=$i;$j <= 6;$j++)
{
if ($j < = 6-1)
{
echo "a";
}else
{
echo "
";
}
}
}
?>
PHP printing Yang Hui triangle customization
Copy code The code is as follows:
http://www.bkjia.com/PHPjc/323807.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323807.htmlTechArticleCopy the code code as follows: ?php //Yang Hui Triangle for ($i=6;$i = 0;$ i--) { for ($j=$i;$j = 6;$j++) { if ($j = 6-1) { echo "ba/b"; }else { echo "br /"; } } } ? PHP print Yang Hui triangle custom...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn