for循环输出:
";
for ($j = 1; $j <= $i; $j++) {
echo "";
echo "$i*$j=" . $i * $j;//"$i*$j="为输出算式后面不带引号的是输出结果
echo " ";
}
echo "";
}
?>
while循环输出:
Document
';
while ($j <= $i) {
echo '';
echo "$i*$j=" . $i * $j;
echo ' ';
$j++;
}
echo '';
$i++;
}
?>
dowhile循环输出
";
$j = 1;
do {
echo "";
echo "$i * $j=" . $i * $j;
echo " ";
$j++;
} while ($j <= $i);
echo "";
$i++;
} while ($i <= 9);
?>
代码需要运行在PHP环境中。安装环境可以看https://www.xxhzm.cn/archives/251/
此处评论已关闭