public class 1127
{
public static void main(String[] args)
{
binomial();
}
public static double binomial(int N, int k, double p)
{
if (N == 0 && k ==0) return 1.0;
if (N < 0 || k < 0) return 0.0;
return (1.0 - p)*binomial(N-1, k, p) + p*binomial(N-1, k-1, p);
}
}
/Volumes/2/Learn_Algorithms/chapter one/1127.java:13: reached end of file while parsing }}
SUBNULNULNULNULNULNULNULNULNUL^ 15 Errors
This is my first time writing Java code and I have a few questions.
I don't think I missed any '{' or '}'
Then how about those series of SUBNULNULNUL...?
How did it calculate out 15 ERRORS?
The name 1127
is not a valid name for a class.
A class name is an identifier and must start with a letter; identifiers cannot start with a digit.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments