I would worry about line 31 : for (int I = 10; I >= 0; I--)
When you read in the data
for (int I = 1; I <= 10; I++)
{
cout << I << ")"; cin >> N[I]; cout << "\n";
}
You populate the value N[1], N[2]... etc. BUT you do not populate the value N[0] that is never set. But in line 31 you loop over I until and including I == 0
. Thus the value printed will be undefined (i.e. anything!)