2 ms·
That Rust is very nice. But a more idiomatic C version would be long factorial(int n) { long result = 1; for (int c = 1; c <= n; c++) r
by emmelaich 7y ago
That Rust is very nice.
But a more idiomatic C version would be
long factorial(int n)
{
long result = 1;
for (int c = 1; c <= n; c++)
result *= c;
return result;
}