Problem:
Factorial

Write a program which reads an integer n and prints the factorial of n. You can assume that n ≤ 20.

Input

An integer n (1 ≤ n ≤ 20) in a line.

Output

Print the factorial of n in a line.

Sample Input

5

Output for the Sample Input

120

Solution in JAVA (judge verdict: Wrong Answer)

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {
	private	static	BufferedReader	br = null;

	static {
		br   = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int	nNum  = parseNum();
		int	nFact = 1;
		for (int n = 2; n <= nNum; n++ ) {
			nFact *= n;
		}
		System.out.println(nFact);
	}

	private static int parseNum() {
		int	nNum = -1;
		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					nNum = Integer.parseInt(line);
				}
			}
		}
		catch (IOException e) {}

		return nNum;
	}
}