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
2014-11-27 02:25:23 Minsuk Kim
very straightforward with python 2.7 - can use recursion to define function. Managed to write two solutions - one with 15 lines the other with only 7 lines
2014-11-04 08:03:22 Devesh Thakur
Nice problem...learnt to deal with large no's
2014-10-30 19:48:10 Prakhar Dev Gupta
Is there some problem with the code??
I am getting WA despite it is not and verified on ideone. The output meets the demand of the question
2014-10-22 11:15:42 Abhay Jain
i seriously don't understand what's wrong with my code.i've tried the code even with the given sample input and it does give the exact sample output!!!
2014-10-10 15:07:14 Wasim Thabraze
@Shivam and @Ankit Please don't post the code here! Utilise forum.
2014-08-17 10:46:09 Akshay Kamthan
Learnt something new and interesting!
Good problem!
2014-08-13 15:12:54 Mohit Bora
can anyone whats wrong in this code
<snip>

Last edit: 2022-09-17 23:07:58
2014-08-13 09:00:03 Rohit Jain
Can anyone tell me..what is wrong with this code. I wrote it in C#
<snip>

Last edit: 2022-09-17 23:07:54
2014-08-12 12:16:07 prashant
Can someone tell me what is wrong with this code
<snip>

Last edit: 2022-09-17 23:07:51
2014-08-05 14:35:33 `Ak
@Adrian Kosowski Weak Running Judge!!
If we do 0! = 0 It gives AC!!
and we know that 0! = 1.....

Last edit: 2014-08-05 14:36:15
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.