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
bhaskar_uoh: 2016-12-03 15:06:52

Last edit: 2016-12-03 15:09:45
addynation: 2016-12-02 14:58:20

int cannot store factorial of 100.
this is why its showing wrong answer.

ashishsb95: 2016-11-27 15:06:30

day#2problem#5

=(Francky)=> Please stop that. Imagine if every one do that !!!

Last edit: 2016-11-27 16:18:31
shekarmania: 2016-11-04 18:39:08

using loops instead of arrays is easy :(

kritisingh1: 2016-10-29 08:48:34

the code worked correctly on ideone, still here it says "wrong answer". Why?

dpgc11: 2016-10-09 15:47:22

I am getting the correct answer but still it's telling me it's wrong.(Not using println in the last line)

nadra7: 2016-09-27 04:46:28

Don't print new line in last

farzadhallaji: 2016-09-20 17:42:48

for last input don't print new line ....

Last edit: 2016-09-20 17:43:16
ssrinet: 2016-09-14 13:21:24

most worst site after submitting right answer showing compilation error...HAckerearth is much better

hsuyaihtar: 2016-08-30 18:54:03

nitish_garg503 , the code you have written, will genearate an output after each input, thus reason of wrong answer. Store them in array and display later, it will work.


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