Submit | All submissions | Best solutions | Back to list |
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
Added by: | adrian |
Date: | 2004-05-28 |
Time limit: | 1s |
Source limit: | 2000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
hide comments
|
||||||||||||||
2013-03-14 13:53:51 Jay H. Bosamiya
source limit is in no way stupid... since, otherwise, people may just hardcode the answers (since n is less than 100) as strings and then just output using if's |
||||||||||||||
2013-02-20 12:00:23 Sivaraman Nagarajan
Great ! Learnt a Technique ! Expecting problems like this I think people shd stop using Java for this ;) Last edit: 2013-02-20 12:04:44 |
||||||||||||||
2013-01-23 17:25:57 raunakrocks
easy1!!not for java programmer :P :P |
||||||||||||||
2013-01-12 14:49:12 rajat pachouri
the code is running on my machine m getting the input and output as: 2 4 24 5 120 is anything still wrong.. |
||||||||||||||
2013-01-12 06:08:07 Avinash Kumar
@NAVYA it may b the problem of inapropriate data type bcoz 99! is too large a no. |
||||||||||||||
2012-12-21 12:44:09 Himanshu
use basic intelligence to solve it..................... |
||||||||||||||
2012-12-12 18:32:49 strings
enjoyed doing it !! :) |
||||||||||||||
2012-12-08 07:08:32 Sidney Milien
@Navya, does your code work for the case when n = 100.? I submitted my code earlier, neglecting this key criteria. largest int using 64bit = 18,446,744,073,709,551,615 Last edit: 2012-12-08 14:04:07 |
||||||||||||||
2012-12-03 17:39:09 Navya
my code is working fine on ideone bt here it is giving wrong ans...cn u tell y?? |
||||||||||||||
2012-11-27 15:33:17 Zhongyuan.Lee
"small"? Indeed, we have to use array to store the number |