Skip to content

Instantly share code, notes, and snippets.

@jforge
Last active March 9, 2016 01:18
Show Gist options
  • Select an option

  • Save jforge/5ec5491750ca020916a1 to your computer and use it in GitHub Desktop.

Select an option

Save jforge/5ec5491750ca020916a1 to your computer and use it in GitHub Desktop.
import java.math.*;
public class A {
public static void main(String[]a) {
System.out.print(a.length<1?1:f(new Long(a[0])));
}
static BigInteger f(long n) {
return n<1?BigInteger.ONE:BigInteger.valueOf(n).multiply(f(n-1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment