题解 | #直角三角形#
直角三角形
https://www.nowcoder.com/practice/7e8a7d83569d49aaa9bc4bb43a9d2d6e
{"css":"","js":"","html":"<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n </head>\n <body>\n <div class='triangle'></div>\n\n <script>\n var triangle = document.querySelector('.triangle');\n // 补全代码\n var str = '';\n for (let i = 1; i <= 3; i++) {\n for (let j = 0; j < i; j++) {\n str += '*';\n }\n triangle.innerHTML += str + '<br>';\n str = '';\n }\n </script>\n </body>\n</html>","libs":[]}