Most likely it should be

for (int i=0; i < n; i++)

If n is the number of words there are, and say there are 9 words for example, and i counts how many words you have seen so far, then as soon...