/*空心直角三角形*/
for (var i = 0; i
(i == 0 || i == 9) ? document.write(Array(i + 2).join("* ") + "
") : document.write("*" + Array(i + 1).join(" ) ") + "*");
}
/*空心菱形*/
var arr = [];
for (var p = 0 p ") : arr.push(Array(6 - p).join(" ) ") + "*" + Array(p * 2 + 1).join(" ") + "*
");
}
(document.write(arr.join) ("")), arr.pop(), document.write(arr.join) ("")), arr.pop(), document.write(arr.反向().join("")));