0

<html>
<head>
<title>
</title>

<script>
var n = 2;
var days = 365;

function factorial() {
        var result = 1;
        for (var i = 1; i <= n; i++) {
            result *= i
      }
       return result;
    }  

var theNumber = function baseExponent (base, exponent) {
    var number = 1;
    for (i=0; i < exponent; i++) {
        var number = base * number;
    }
    return number
}


document.write(factorial()*182)/(theNumber(days, n)
//i used the (formula n! * combination 365 2)/365^n
//i cheated a bit and just did the math for parts of this specific problem
</script>
</head>
<body>




</body>
</html>

タグの「キャッチされていない構文エラー:予期しない入力の終了」が発生しますが、その理由がわかりません。何か案は?

4

1 に答える 1

10

「document.write」行には、比類のないオープンパレンがあります。

于 2012-02-04T04:29:27.043 に答える