Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. package lesson6.task1;
  2.  
  3.  
  4. import java.math.BigInteger;
  5.  
  6. public class Fact {
  7. public static BigInteger factorial(BigInteger a){
  8.  
  9. if (a.equals(BigInteger.ZERO)) return BigInteger.ONE;
  10. else return a.multiply(factorial(a.subtract(BigInteger.ONE)));
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement