乘法口诀表
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>乘法口诀表</title>
</head>
<body>
<style type="text/css">
.bgc{
background-color: #aaa;
}
</style>
<table>
<?php for ($i=1; $i <=9 ; $i++) { ?>
<?php if($i%2) { ?>
<tr class="bgc">
<?php }else{ ?>
<tr>
<?php } ?>
<?php for ($j=1; $j <=$i ; $j++) { ?>
<td width="80px" height="30px">
<?php echo "$j*$i=",$j*$i; ?>
</td>
<?php } ?>
</tr>
<?php } ?>
</table>
</body>
</html>
100以内偶数的和(php代码)
<?php
echo "100以内的偶数有:";
echo "<br>";
for ($i=0; $i <=100 ; $i+=2) {
$j+=$i;
echo "$i ,";
}
echo "<br>";
echo "100以内偶数的和是:";
echo "$j";
?>
|