
DuuhCarvalho
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
DuuhCarvalho deu reputação a Skydangerous em GetFatorialNumber()Ui, me impolgei em fazer funções .D
Estudei como funciona fatoriamento de um número inteiro, e resolvi por em prática.
Ta ai, pra usar
function GetFatorialNumber(fatorial) local a,b = fatorial,fatorial print (a,"*") while (b > 1) do b = b - 1 a = a*b if b == 1 then print (b,"=" , a) else print(b,"*") end end end a = 5 -- Aqui bota um numero inteiro para o fatoramento return (GetFatorialNumber(a)) Exemplo de Print: 5 * 4 * 3 * 2 * 1 = 120
Prontinho, rode sem problemas
Funfando 100% , e desenvolvido por mim