Sphere Online Judge

SPOJ Problem Set (classical)

24. Small factorials

Problem code: FCTRL2

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

Added by:Adrian Kosowski
Date:2004-05-28
Time limit:1s
Source limit:2000B
Languages:All except: TECS

hide comments
2010-08-29 05:33:09 kiran
i'm getting rite answer ...is it any prob in my program ...if it is pls reply me
2010-08-26 15:07:23 Namandeep Singh Chugh
run time error(NZEC)
i am getting answers for all values, tested for i=0 to 100, no hault in program...
any help??
2010-08-17 23:38:16 Malkenar
@Ajeet kumar Did you test 100!
2010-08-12 20:01:40 Ajeet kumar
my compiler give me correct answer,but when i'm submitting in ur compiler it is giving wrong answer.. pl tell me why ??
2010-07-20 22:53:04 vengadesh
can any one tell me correct ans
my link is vengadesh45@gmail.com



Last edit: 2010-07-20 22:54:07
2010-07-02 15:06:07 Nayra Ahmed
My own compiler gives me right answer , but when i submit the code here it gave me a run time error
what should I do to solve this problem ??

Last edit: 2010-07-02 15:08:29
2010-06-18 19:40:42 prabhath
what datatype do u use for printing such a big data type
2010-06-09 04:44:23 D. Nose Indra
I catch it...! I've done..
2010-05-31 19:35:54 shailesh
100! is 933262154439441526816992388562667004907159682643816214685929638952175999932
2991560894146397615651828625369792082722375825118521091686400000000000
0000000000000

158 characters long!!

Last edit: 2010-05-31 19:40:44
2010-05-29 09:53:30 D. Nose Indra
I have do everything for it .. except-less, caching.. I've done memorization but the problem I faced was Integer value that's too big.. Any solution for c++??
SPOJ System © 2010 Sphere Research Labs. All Rights Reserved.