FCTRL2 - Small factorials

You are asked to calculate factorials of some small positive integers.

Input

An integer t, 1<=t<=100, denoting the number of testcases, followed by t lines, each containing a single integer n, 1<=n<=100.

Output

For each integer n given at input, display a line with the value of n!

Example

Sample input:
4
1
2
5
3

Sample output:

1
2
120
6

Added by:adrian
Date:2004-05-28
Time limit:1s
Source limit:2000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2015-10-18 19:06:45
100! is not a small factorial.
2015-09-30 20:18:21
works successfully on ideone but wrong answer here.
2015-09-29 04:04:44
Very easy in Python! (=
2015-09-12 17:10:12
this was easy, sort the input and use the previous one to calculate the next. then display it the input order
2015-08-29 20:34:26 archit saxena
ac in second attempt
2015-08-29 05:58:27 Achmad Rozikin
my code looks ugly because the source limit....
but i got AC
2015-08-27 08:13:06 Ashutosh Singh Chandel
no need to include 0! case. my code was accepted .
2015-08-23 11:56:04
can someone elaborate the problem? I am struck in the language of the problem
2015-08-19 12:45:06
my solution is giving right answer for every test case....but still i m getting wrong answer........
2015-08-17 13:26:32
how to handle large numbers in c++??
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.