Skip to content

Commit 2e6b7bc

Browse files
committed
biginteger problem done
1 parent fb6c74b commit 2e6b7bc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.hackerrank.algorithms.implementation;
2+
3+
import java.math.BigInteger;
4+
import java.util.Scanner;
5+
6+
/**
7+
* Created by ramswaroop on 29/05/2016.
8+
*/
9+
public class ExtraLongFactorials {
10+
public static void main(String[] args) {
11+
Scanner in = new Scanner(System.in);
12+
int n = in.nextInt();
13+
BigInteger res = BigInteger.ONE;
14+
for (int i = n; i > 0; i--) {
15+
res = res.multiply(BigInteger.valueOf(i));
16+
}
17+
System.out.println(res);
18+
}
19+
}

0 commit comments

Comments
 (0)