时间:2021-07-01 10:21:17 帮助过:9人阅读
//杨辉三角
for ($i=6;$i >= 0;$i--)
{
for ($j=$i;$j <= 6;$j++)
{
if ($j <= 6-1)
{
echo "a";
}else
{
echo "
";
}
}
}
?>
PHP打印杨辉三角自定义
代码如下:
function yanghui($line)
{
echo "
"; echo $yh[$i][$j]; echo " | ";
http://www.bkjia.com/PHPjc/323807.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/323807.htmlTechArticle 代码如下:?php //杨辉三角 for ($i=6;$i = 0;$i--) { for ($j=$i;$j = 6;$j++) { if ($j = 6-1) { echo "ba/b"; }else { echo "br /"; } } } ? PHP打印杨辉三角自定...