A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
7
Task/Factorial/Java/factorial-2.java
Normal file
7
Task/Factorial/Java/factorial-2.java
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
public static long fact(final int n) {
|
||||
if (n < 0){
|
||||
System.err.println("No negative numbers");
|
||||
return 0;
|
||||
}
|
||||
return (n < 2) ? 1 : n * fact(n - 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue