1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
int main()
{
int numStudents;
string name, name1, name2, name3, name4, name5, name6, name7, name8, name9, name10, name11, name12, name13, name14, name15, name16, name17, name18, name19, name20, name21, name22, name23, name24, name25;
//get the number of students
cout << "Enter the number of students: ";
cin >> numStudents;
//check for 1 to 25 students
if (numStudents < 1 || numStudents > 25)
cout << "Error: Please enter a number between 1 and 25." << endl;
//get student names
for (int count = 1; count <= numStudents; ++count)
{
cout << "Enter the students name: " << endl;
cin >> name;
}
system("pause");
return 0;
}
|