Created
August 31, 2018 02:26
-
-
Save jaclync/7e2c2aef5999661770cf087ee9c3bba8 to your computer and use it in GitHub Desktop.
Working version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.math.*; | |
public class NMul { | |
public static void main(String[] args) { | |
BigInteger sum; | |
long n; | |
Scanner sc = new Scanner(System.in); | |
while (sc.hasNext()) { | |
n = sc.nextLong(); | |
sum = BigInteger.valueOf(1); | |
for (long i = 1; i <= n; i++) { | |
sum = sum.multiply(BigInteger.valueOf(i)); | |
} | |
System.out.println(sum); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment