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

hide comments
mbrc: 2012-08-21 13:57:05

93326215443944152681699238856266700490715968264381621468592963
89521759999322991560894146397615651828625369792082722375825118
5210916864000000000000000000000000=100!

Last edit: 2012-08-21 13:57:47
Gyorgy Deak: 2012-08-03 21:57:43

The string can store it...

Asha Tulsyan: 2012-07-30 22:09:31

which data type to store 100!

i_am_what_i_am: 2012-07-22 09:44:12

can someone with accepted code post the value of 100 factorial cuz i want to cross check if mine is correct

wahdan: 2012-07-05 12:26:41

whats wrong with this code ?
<snip>
plz i need help

Last edit: 2022-09-17 23:07:31
StupidGuy: 2012-07-01 09:08:07

Finally...Finally AC! :)

Derlys Daniel Alvarado Mendoza[UCLA-ve]: 2012-06-23 14:13:23

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
Kirtika Ruchandani: 2012-06-22 13:08:24

Python math.factorial() is fast enough - that makes this problem trivial.

B.R.ARVIND: 2012-03-31 06:57:08

use char array in case of c and string in case of c++.. in java ,can use BigInteger

chandanapericharla: 2012-03-29 16:08:24

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

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