Wednesday, May 23, 2018

FCTRL2 - Small Factorials : Classical

#The solution in Python 3 is as follows:

t = int(input())                      #No.of test cases
i=0
while i<t:
    a=int(input())
    j=1
    fact=1
    while j<=a:
        fact=fact*j                    #compute the factorial
        j+=1
    print(fact) 
    i+=1


#Keep visiting for more solutions of SPOJ problems in Python 3.Thank you!!!