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

mellow.gif так надо?