My alternative handles this case. You could place an 'if' around each prompt, something like this:
if (N >= 3) {
cout << "Enter score 3 ";
cin >> score3;
}
if (N >= 4) {
cout << "Enter score 4 ";
cin >> score4;
}
Doing that, you only prompt for and read in the number of scores that you need.
Software Zen: delete this;
Fold With Us![^]