adding to vector

This commit is contained in:
Alexander Zhirov 2021-06-21 10:54:54 +03:00
parent 74c1f5598b
commit 496554687c
1 changed files with 25 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#include <iostream>
#include <vector>
#include "exercise_1.hpp"
using namespace std;
@ -7,9 +8,30 @@ int Student::count = 0;
int main()
{
Student Alex("Олег", 20, GENDER_MALE, 75.2, 2020);
Alex.printInfo();
Student::printCount();
// Student students[] =
// {
// Student("Олег", 20, GENDER_MALE, 75.2, 2020),
// Student("Андрей", 19, GENDER_MALE, 72.8, 2020),
// Student("Анастасия", 20, GENDER_FEMALE, 55.2, 2020),
// Student("Ольга", 21, GENDER_FEMALE, 49.3, 2020),
// Student("Владимир", 19, GENDER_MALE, 69.9, 2020)
// };
//
// Student::printCount();
//
// students[0].printInfo();
// students[2].printInfo();
vector<Student> students;
students.emplace_back("Олег", 20, GENDER_MALE, 75.2, 2020);
students.emplace_back("Андрей", 19, GENDER_MALE, 72.8, 2020);
students.emplace_back("Анастасия", 20, GENDER_FEMALE, 55.2, 2020);
students.emplace_back("Ольга", 21, GENDER_FEMALE, 49.3, 2020);
students.emplace_back("Владимир", 19, GENDER_MALE, 69.9, 2020);
Student::printCount();
return 0;
}