123456789101112
int factorials[10] = { factorial(0), factorial(1), factorial(2), factorial(3), factorial(4), factorial(5), factorial(6), factorial(7), factorial(8), factorial(9) };
12345678
static int factorial(int n) { int fact = 1; for (int i = 2; i<=n; i++) { fact = fact * i; } return fact; }