Professional Documents
Culture Documents
Datastructurehomework 00
Datastructurehomework 00
while (!tempStack.IsEmpty()) {
Student currentStudent = tempStack.Top();
cout << "Name: " << currentStudent.name << "\n";
tempStack.Pop();
}
cout << "----------------\n";
}
int main() {
StackType<Student> studentStack;
for (int i = 1; i <= 10; ++i) {
Student student;
student.name = "Student" + to_string(i);
studentStack.Push(student);
}
DisplayStudentList(studentStack);
cout << "Enter the number of students to delete: ";
int studentsToDelete;
cin >> studentsToDelete;
return 0;
}