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

Input:
4
1
2
5
3

Output:
1
2
120
6

hide comments
pyskmr: 2019-05-30 19:39:57

python is a shit language,
i did it via python with no logic at all

Last edit: 2019-05-30 19:40:06
thunderboltz_: 2019-05-30 10:52:13

printf("% ",factorial); //factorial belongs to double
Anyone do tell me. What should be written? in this blank space to remove that trailing zeros (0s) after decimal point

thunderboltz_: 2019-05-30 10:48:02

we shuold use "double" data type to get 100! and most importantly output doesn't have trailing zeros (0s) .

tasrin_sultana: 2019-05-24 18:42:13

Good problem... I have learned very interesting method..

puma_123: 2019-01-05 13:59:14

i m getting wrong answer in c though it run well on codeblocks for the given test case.i m using an array to store the given set of numbers and recursive function fact to get factorial.where is the problem?

yash_singh031: 2018-12-28 17:00:08

Friends I don't know I ran my code on codeblocks it ran successfully but here on ideone.com it is giving runtime error!!!

msnitish: 2018-12-16 08:10:26

Wow! Carrying is a concept we were taught in class 2.

sudesh12345: 2018-12-15 20:02:20

AC in one go in C++

phoenix0o0: 2018-11-23 12:59:47

Try not to do this problem in Java or python.
You will learn something new.

Last edit: 2018-11-23 13:00:21
unseen07: 2018-11-07 12:38:22

this is why I love python


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