We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb6c74b commit 2e6b7bcCopy full SHA for 2e6b7bc
src/com/hackerrank/algorithms/implementation/ExtraLongFactorials.java
@@ -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