Problema de programación en lenguaje C: s=1! +2! +3! +4! +5 ¡Usa bucles anidados!
#include
#include
int ans = 0;
#define ans(n) for(int i = 1; i <= n; ++i)ans += calc(i, 1)
int calc(int i, int tot)
{
if(i == 1)return tot;
tot *= i;
return calc(i - 1, tot);
}
int main()
Tot *= i
return calc(i - 1, tot
}
int main()
{
ans(5);
printf("%d", ans);
devuelve 0 ;
}