<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>九九乘法表</title>
<script>
// 行 row
// 列 line
// star 字符串 空变量
var star = '';
for (var row = 1; row <= 9; row++) {
for (var line = 1; line <= row; line++) {
star += line + ' * ' + row + ' = ' + (line * row) + '\t';
}
star += '\n';
}
console.log(star); //在控制台输出
</script>
</head>
<body>
</body>
</html>
网友评论