Home > Backend Development > PHP Tutorial > php实现的九九乘法口诀表简洁版_PHP

php实现的九九乘法口诀表简洁版_PHP

WBOY
Release: 2016-06-01 11:50:37
Original
1332 people have browsed it

九九乘法口诀表也是很多面试考试的程序题,考察php面试者的逻辑思维能力,主要就是对算法的理解和运用,下面是小编用php写的输出九九乘法口诀的php代码:

<&#63;php
for($i=1;$i<=9;$i++)
{
for($j=1;$j<=$i;$j++)
{
echo “$i*$j=”.$i*$j.' ‘;
}
echo ‘<br />';
}
&#63;>
Copy after login

看过之后,是不是很简单,就是两个循环,外层控制循环行数,内层控制每行输入的口诀个数。

输出结果截图:

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template