fork(1) download
  1. import java.util.Scanner;
  2. import java.math.BigInteger;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Scanner in = new Scanner(System.in);
  9. int a = in.nextInt();
  10. BigInteger [] f = new BigInteger[30000];
  11. f[0] = BigInteger.valueOf(1);
  12. for(int i = 1; i <= a; i++)
  13. {
  14. f[i]=f[i-1].multiply(BigInteger.valueOf(i));
  15. }
  16. System.out.print(f[a]);
  17. }
  18. }
Success #stdin #stdout 0.07s 2184192KB
stdin
4
stdout
24