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
Aakash Chandrasekaran: 2013-12-29 09:19:12

nice problem :)

Denys: 2013-12-27 08:51:38

I've checked results of my program with table of factorials - everything looks good for all possible inputs (0<=n<=100), for example for 100! = 93326215...000000000. It looks like an error in test cases, please can anybody check tests?

Last edit: 2013-12-27 13:14:58
Abhishek Sharma: 2013-12-24 17:50:12

"wrong answer" is displayed,despite running correctly on my terminal.
What could be possible error?

Jinal : 2013-12-09 06:33:03

My code is perfectly correct..works right on ideone, bt still shows "wrong answer" here....pls someone help.....

Shivam Dimri: 2013-12-08 07:45:10

it depends which language you are choosing to code this problem, java is very helpful as it allows user to handle big integer calculations and manipulations easily whereas in c++ you need to store big integers in form of array of digits.

Abhishek Tyagi: 2013-12-01 23:04:54

Have you guys tried the program for values >21??

Last edit: 2013-12-01 23:05:03
Rahul Jain: 2013-11-09 09:33:48

after n=34, 0 gets printed ..WHY??

Stalcone: 2013-11-08 04:10:35

@Pratham Pandey, that's impossible due to condition: 1<=n<=100.

Last edit: 2013-11-08 04:10:59
userx: 2013-11-07 19:05:29

wat if we give the input 0?????

do_do: 2013-10-30 03:42:03

sir i m submittinng the right code,and my code is perfectly running on local terminal,,but spoj saying "wrong answer".someone plz help.


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