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
Vikas Yadav: 2012-02-29 16:41:20

what name to give to file in java????

Dario Pavlovic: 2012-02-23 01:23:12

im really not sure why im getting a wrong answer here, i checked almost all possible solutions with wolfram alpha and still getting wa.

Last edit: 2012-02-23 01:24:30
Mukund Kumar: 2011-12-30 12:46:08

i m getting ri8 answr on turbo compiler....hwevr gettin ce on it.....plz help

Santiago Zubieta: 2011-12-06 22:54:37

Use BigInteger in Java..

jayanth kumar: 2011-11-08 05:54:10

how to store values from 40! to 100!
i am not getting the correct output.

Dominik: 2011-10-04 21:12:22

I sent 10 times, tested more than 10 numbers like 0,1,2,3,4,5,10,20,30,50,60,70,80,90,100... All are correct and I'm printing cout << endl; after each (I also tried with printf("\n");... And whole time I'm getting wrong answer T_T, is there some kind of bug?? (programiming in C++) Thx for any reply

jayesh hathila: 2011-10-02 06:51:27

i ran a for loop and printed all the test cases from 1 t0 100 but here its giving "nzec".plz help me

Hitman: 2011-09-25 05:32:55

I got runtime error NZEC, while uploading my code in python. why??

Bishma: 2011-09-25 04:49:39

www.wolframalpha.com says 100! = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
and my output says that in my computer. Why am I getting wrong answer here?

Santiago Palacio: 2011-09-17 04:51:56

@kostis: long double wont do enough for 100!


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