Ruby:
#factorial de 8
(1..8).inject{|x,y| x*y}
Python 2.5:
def fact(x):
a = 1
for i in range(1,x+1):
a = a*i
return a
Python 2.6:
import math
math.factorial(8)
Copyright © 2009 Your Blog. All Rights Reserved.
Powered by Blogger | Theme by Skinpress | Brought to Blogger by Dante Araujo and Deluxe Templates
No hay comentarios:
Publicar un comentario
los comentarios son publicados inmediatamente, sin moderacion. Por favor, sea responsable.