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
2011-09-16 19:19:45 Kostis Karantias
I use long double and I output it with "%.0Lf".

For 100! I get:
93326215443944152668565874012822813729098311759684
57842257147719122795848879719683777606888162568261
38387766738917471856517769978700228574656024367967
80642304

What are these trailing zeroes you guys have?

Last edit: 2011-09-16 19:20:09
2011-08-29 15:24:58 kousik
try checking it for larger values like 50, 60 and check if your code produces the exact result with precision upto 100+digits :)
2011-08-29 11:36:49 sravanthi
i checked in ideone.com stillhere its showing wrong ans
2011-08-11 11:26:29 Kuushagra Mittal
check your answer for 50 ,40,etc
2011-08-07 16:07:06 defcon3
Can someone please clarify something for me - Are the inputs all entered at the same time? if it is, how can I allocate memory for the inputs if I dont know how many there will be before runtime?
2011-07-26 21:13:30 aashima
iam facing the same problem. al factorials are correct !still wrong ans?????
2011-07-25 18:47:03 A.Ranjitha
wats NZECerror?????
2011-07-14 21:33:53 Ryan OHara
I get a runtime error NZEC. But how do you return an exit code with JavaScript??!
2011-07-09 07:11:03 Ying Sihao
You should use ExtEnded.
I hope you can succeed.
2011-07-05 14:41:11 luca tavernari
i'm using a long double but it seams not to be enough, what should i do ?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.