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
Devesh Thakur: 2014-11-04 08:03:22

Nice problem...learnt to deal with large no's

Prakhar Dev Gupta: 2014-10-30 19:48:10

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

Abhay Jain: 2014-10-22 11:15:42

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!!!

Wasim Thabraze: 2014-10-10 15:07:14

@Shivam and @Ankit Please don't post the code here! Utilise forum.

Akshay Kamthan: 2014-08-17 10:46:09

Learnt something new and interesting!
Good problem!

Mohit Bora: 2014-08-13 15:12:54

can anyone whats wrong in this code
<snip>

Last edit: 2022-09-17 23:07:58
Rohit Jain: 2014-08-13 09:00:03

Can anyone tell me..what is wrong with this code. I wrote it in C#
<snip>

Last edit: 2022-09-17 23:07:54
prashant: 2014-08-12 12:16:07

Can someone tell me what is wrong with this code
<snip>

Last edit: 2022-09-17 23:07:51
`Ak: 2014-08-05 14:35:33

@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
Deepanshu Thakur: 2014-07-30 20:37:00

even this is giving me wrong result
<snip>

Last edit: 2022-09-17 23:07:44

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