fork download
  1. class Main{
  2. public static void main (String[] args) throws java.lang.Exception {
  3. java.util.Scanner i = new java.util.Scanner(System.in);
  4. int n = i.nextInt();
  5. long factorial = 1;
  6. for(int k = 1; k <= n; k++) {
  7. factorial *= k;
  8. }
  9. System.out.print(factorial);
  10. }
  11. }
Success #stdin #stdout 0.09s 35436KB
stdin
20
stdout
2432902008176640000