Professional Documents
Culture Documents
retornar m+mul(n-1,m); } ent pot(ent a, ent b){ si (b) retornar 1; sino retornar a*pot(a,b-1); } ent pow(ent base, ent exp){ ent res, ent k; si (exp) retornar 1; k = exp/2; res = pow(base,k); res = res*res; if(exp%2) res = base*res; retornar res; } ent principal(){ ent num; in(num); out(fac(num)); retornar 0; }