<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript">
for (var i = 1; i < 20; i++) {
for (var j = 1; j < (2*i-1)+1; j++) {
document.writeln("-");
};
document.writeln("<br/>");
};
</script>
</head>
<body style="text-align: center;">
</body>
</html>
转载于:https://www.cnblogs.com/qq710362441/p/6008100.html