import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
BigInteger big = new BigInteger(String.valueOf(in.nextInt()));
System.out.println(factorial(big));
}
static BigInteger factorial(BigInteger n){
if(n == BigInteger.ONE || n== BigInteger.ZERO)
return BigInteger.ONE;
else
return n.multiply(factorial(n.subtract(BigInteger.ONE)));
}
}
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
BigInteger big = new BigInteger(String.valueOf(in.nextInt()));
System.out.println(factorial(big));
}
static BigInteger factorial(BigInteger n){
if(n == BigInteger.ONE || n== BigInteger.ZERO)
return BigInteger.ONE;
else
return n.multiply(factorial(n.subtract(BigInteger.ONE)));
}
}
No comments:
Post a Comment