Linux 拨号vps windows公众号手机端

php实现99乘法表

lewis 6年前 (2019-03-22) 阅读数 9 #程序编程
文章标签 PHP

使用php实现99乘法表的方法:1.使用for循环实现99乘法表;2.使用while循环实现99乘法表;

使用php实现99乘法表的方法

1.使用for循环实现

or($i=1;$i<10;$i++){

for($j=1;$j<=$i;$j++){

echo$i.'*'.$j.'='.$i*$j.'&nbsp;&nbsp;&nbsp;';

}

echo'<br/>';

}

2.使用while循环实现

$m=1;

while($m<10){

$n=1;

while($n<=$m){

echo$m.'*'.$n.'='.$m*$n.'&nbsp;&nbsp;&nbsp;';

$n++;

}

echo'<br>';

$m++;

}


版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门