unsigned fact(unsigned n) { unsigned r; for (r = 1; n > 1; n--) r *= n; return r; }