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
s_a_h_i_l_ahu: 2017-05-15 16:37:16

i m getting answer upto 35! correct...... but after that it is giving wrong answer.....what could be the problem

aditibora: 2017-05-10 11:13:13

if a user enters t=4 and three values of n within the range but one value of n>100 what should the program behave like? Please specify.

keerthi_97524: 2017-05-06 17:52:34

Wat should be the factorial of zero ?? Is it one or zero???

chatr004: 2017-04-20 00:35:11

How to see memory used by what things in SPOJ?

rohit9934: 2017-04-03 16:40:21

Python killing it in just 4 lines.

arthur1991: 2017-03-23 08:31:59

i love qianqian

kshubham02: 2017-03-20 22:38:02

avi_02 if your code gives correct output for certain test cases then it is not guaranteed to be AC. There are a number of test cases which are not shown but your code is run on and output compared against.
Try using Spoj Toolkit and see if your code gives correct answer for other custom inputs as well.

buy_aka: 2017-03-15 05:23:07

<Don't post any source code here. >

Last edit: 2017-03-15 05:30:04
amulyagaur: 2017-03-13 16:42:23

use bigIntegers in java.........cakewalk

Last edit: 2017-03-13 16:42:48
tutshimanshu: 2017-03-07 08:35:10

not working yar
please help big int in compulsory if i will do it in other way then


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