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 C# (judge verdict: Accepted)

//再帰を使ってみる
using System; 
public class Factorial 
{
	public static long Fac(long i) 
	{
		return ((i <= 1) ? 1 : (i * Fac(i-1))); 
	} 
}
class MainClass 
{
	public static void Main() 
	{
		string s = Console.ReadLine();
		try
		{
			long num = Int64.Parse(s);
			Console.WriteLine(Factorial.Fac(num)); 
		}
		catch (System.FormatException)
		{
			Console.WriteLine("Invalid input specified");
		}
	}
}