Skip to content

Instantly share code, notes, and snippets.

@imEhllBdPGMVaArZ
Created October 8, 2014 14:05
Show Gist options
  • Save imEhllBdPGMVaArZ/3a1a9529b80b8f262c03 to your computer and use it in GitHub Desktop.
Save imEhllBdPGMVaArZ/3a1a9529b80b8f262c03 to your computer and use it in GitHub Desktop.
九九乘法表
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>9x9</title>
<style>
span { padding: 0 10px; }
</style>
</head>
<body>
<?php
for($j = 1; $j <= 9; $j++) { //输出乘数
echo "<p>";
for($k = 1; $k <= $j; $k++) { //输出被乘数
echo "<span>" . $j . "*" . $k . "=" . $j * $k ."</span>";
}
echo "</p>";
}
?>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>9x9</title>
<style>
ul { float: left; margin-top: 0; margin-bottom: 0; list-style: none; }
</style>
</head>
<body>
<?php
for($j = 1; $j <= 9; $j++) { //输出乘数
echo "<ul>";
for($k = 1; $k <= 9; $k++) { //输出被乘数
echo "<li>". $j . "*" . $k . "=" . $j * $k . "</li>";
}
echo "</ul>";
}
?>
</body>
</html>

###haskell-01.php(教程)

按照行来输出

###haskell-02.php(自己,脑子转不过来,太死了)

按照列来输出,同时设想当前列出现和上一列若有相同的值,那么,当前列出现相同值的则用空白替代以形成阶梯表

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment