JS——杨辉三角
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
function out (a) {
for(var i=0;i<a.length;i++){
for(var j=0;j<a[i].length;j++){
document.write(a[i][j]+"  ");
}
document.write("<br/>");
}
}
var b=[];
for(var i=0;i<9;i++){
b[i]=[];
b[i][0]=1;b[i][i]=1;
}
for(var i=2;i<9;i++){
for(var j=1;j<i;j++){
b[i][j]=b[i-1][j-1]+b[i-1][j];
}
}
out(b);
</script>
</body>
</html>