Update apprentice.c

fix bug