cout << "Enter the number of students: ";
int numberStudents = 0;
cin >> numberStudents;
double scores[] = {0};
cout << "Enter " << numberStudents << " scores: ";
for (int i = 0; i < numberStudents ; i++)
{
cin >> scores[i];
}
double best = scores[0];
for (int i = 1; i < numberStudents ; i++)
{
if (scores[i] > best) best = scores[i];
}
for (int i = 0; i < numberStudents ; i++)
{
if (scores[i] >= best - 10)
cout << "Student " << i << " is " << scores[i] << " and grade is A";
elseif (scores[i] >= best - 20)
cout << "Student " << i << " is " << scores[i] << " and grade is B";
elseif (scores[i] >= best - 30)
cout << "Student " << i << " is " << scores[i] << " and grade is C";
elseif (scores[i] >= best - 40)
cout << "Student " << i << " is " << scores[i] << " and grade is D";
else
cout << "Student " << i << " is " << scores[i] << " and grade is F";
cout<< endl;
}