alexan0308,
Вариант)))
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
var m=3, n=4, s=10;
k = s-(m+n);
for (var arr = [0, 0, 0]; k;) {
for (var i = k; 0 < i;) arr[2] = --i, arr[1] = k - i, document.write(Array(arr[0] + 1).join("-") + Array(m + 1).join("*") + Array(arr[1] + 1).join("-") + Array(n + 1).join("*") + Array(arr[2] + 1).join("-") + "<br />");
k--;
arr[0]++
};
</script>
</body>
</html>