int fact( int n ) { if ( n < 0 ) return 0; int f = 1; while ( n > 1 ) f *= n--; return f; }