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
|
||||||||||||||
2019-12-02 19:20:23
Why isn't recursion working for large numbers? |
||||||||||||||
2019-09-29 15:00:26
yea use an array for storing large numbers , : ) to overcome overflow |
||||||||||||||
2019-07-26 12:13:58
array method Last edit: 2019-07-26 14:18:51 |
||||||||||||||
2019-07-17 19:23:01
Initially assumed that we must use java or other languages to calculate factorial of 100 this is my 1st ever program accepted in C learnt a new technique thank you |
||||||||||||||
2019-07-09 19:41:38
why my code using dp is given WA? |
||||||||||||||
2019-06-26 10:15:51
i got the Test cases correct but got a wrong answer... |
||||||||||||||
2019-06-15 05:41:56
any other solution than the biginteger? Last edit: 2019-06-15 05:46:49 |
||||||||||||||
2019-06-10 02:33:55
tusharupadhyay it is correct for small positive numbers but for large numbers such as 100,99,98 it is giving wrong result as range of int excedded |
||||||||||||||
2019-05-30 19:39:57
python is a shit language, i did it via python with no logic at all Last edit: 2019-05-30 19:40:06 |
||||||||||||||
2019-05-30 10:52:13
printf("% ",factorial); //factorial belongs to double Anyone do tell me. What should be written? in this blank space to remove that trailing zeros (0s) after decimal point |