- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
var n = prompt() - -1;
document.write(
"<table><tr style='font-weight:bold'>" +
Array.apply(null, Array(n))
.map(function(_, i){
return "<td style='font-weight:bold'>" +
Array.apply(null, Array(n))
.map(function(_, j){
return (i || j) ? (i || 1)*(j || 1) : "";
}).join("</td><td>") + "</td>";
}).join("</tr><tr>") +
"</tr></table>"
)
Комментарии (3) RSS