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
2016-02-01 02:29:29
For those that are creating their own "biginteger" objects or structs or whatever, make sure your display methods print a line after printing all the digits. (that might be causing wrong answers)
2016-01-25 22:02:49
though m getting correct answer, its telling wronge :(
2016-01-09 18:53:00
Giving wrong answer. Mine's right though
2016-01-03 22:45:23 Thomas Dybdahl Ahle
I thought you couldn't use boost with spoj? http://discuss.spoj.com/t/boost/2751
When was this changed?
2016-01-02 15:11:04
my 0.6 :)
2015-12-18 10:27:17
Is there any way I can bigInteger using boost (C++) . Thanks in advance .
2015-12-17 11:20:32
For C++ users, use the boost library, then your code should look like ordinary factorial calculation, with 1 extra line of #include!
2015-12-15 17:45:17
Though I am getting a correct answer, I am getting a wrong answer comment.
2015-12-09 19:25:01
Though I'm getting correct answer, it tells that the answer is wrong!


Last edit: 2015-12-09 19:27:37
2015-12-09 15:31:37
java.Math.BigInteger feel comfort with this. 0,12 sec
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.