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
2012-08-21 13:57:05 mbrc
93326215443944152681699238856266700490715968264381621468592963
89521759999322991560894146397615651828625369792082722375825118
5210916864000000000000000000000000=100!

Last edit: 2012-08-21 13:57:47
2012-08-03 21:57:43 Gyorgy Deak
The string can store it...
2012-07-30 22:09:31 Asha Tulsyan
which data type to store 100!
2012-07-22 09:44:12 i_am_what_i_am
can someone with accepted code post the value of 100 factorial cuz i want to cross check if mine is correct
2012-07-05 12:26:41 wahdan
whats wrong with this code ?
<snip>
plz i need help

Last edit: 2022-09-17 23:07:31
2012-07-01 09:08:07 StupidGuy
Finally...Finally AC! :)
2012-06-23 14:13:23 Derlys Daniel Alvarado Mendoza[UCLA-ve]
I tested all the cases and it works but it says "wrong answer" I need help
my email: <Snip>

Last edit: 2023-06-18 20:58:22
2012-06-22 13:08:24 Kirtika Ruchandani
Python math.factorial() is fast enough - that makes this problem trivial.
2012-03-31 06:57:08 B.R.ARVIND
use char array in case of c and string in case of c++.. in java ,can use BigInteger
2012-03-29 16:08:24 chandanapericharla
On checking I found that it works good only till 22!(c lang) from 23!(used double to store the factorial) the zeros are being omitted. I could not make out a what the problem is. Can any one please help me out. Thank you in advance.


Last edit: 2012-03-29 16:10:59
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.