Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! in one line.
Sample Input
1 2 3
Sample Output
1 2 6import java.math.BigDecimal; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); while(s.hasNextInt()){ BigDecimal b = BigDecimal.ONE; int n = s.nextInt(); for(int i=1;i<=n;i++){ b = b.multiply(BigDecimal.valueOf(i)); } System.out.println(b); } } }