思路还是跟不上我现在就是仿照你们的死记硬背,也许是基础太差吧,只能慢慢来了。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>3月26号作业</title>
<link rel="stylesheet" href="">
</head>
<body>
<script type="text/javascript">
// 99乘法表
document.write('99乘法表');
document.write('<hr>');
for (var i=1; i<=9; i++) {
for (var j=i; j<=9; j++) {
var kong=" "
if (i*j<10) {
kong+=" "
}
document.write(i+'x'+j+'='+(i*j)+kong);
}
document.write('<br>');
}
document.write('<hr>');
document.write('*三角');
document.write('<hr>');
// *三角
var i=1;
var kong=" ";
var xing="*";
while(i<=10){
k=1;
y=9;
while(y>i){
document.write(kong);
y--;
}
while(k<=i*2-1){
document.write(xing);
k++;
}
document.write("<br>")
i++;
}
// 99加法表
document.write('<hr>');
document.write('99加法表');
document.write('<hr>');
for (var i=1; i<=9; i++) {
for (var j=i; j<=9; j++) {
var kong=" "
if (i+j<10) {
kong+=" "
}
document.write(i+'+'+j+'='+(i+j)+kong);
}
document.write('<br>');
}
</script>
</body>
</html>