#include <iostream>
#include <stdio.h>
using namespace std;
struct student
{
string name;
string number;
string date;
};
class Group
{
private:
student * B;
int n;
public:
Group()
{
n = 0;
B = NULL;
}
Group(int _n)
{
n = _n;
B = (student*) new student[n];
for (int i=0; i<n; i++)
{
B[i].name = "";
B[i].number = "";
B[i].date = "00/00/00";
}
}
~Group()
{
if (n>0)
delete[] B;
}
int GetN() { return n; }
student& operator[](int index)
{
if ((index>=0)&&(index<n))
return B[index];
else
{
student BB;
BB.name = "";
BB.number = "";
BB.date = "00/00/00";
return BB;
}
}
};
int main()
{
Group BB(3);
BB[0].name = "Popov";
BB[0].number = "M23";
BB[0].date = "20/02/93";
BB[1].name = "Popova";
BB[1].number = "M28";
BB[1].date = "27/02/93";
BB[2].name = "Popovich";
BB[2].number = "M21";
BB[2].date = "20/02/95";
string title;
string num;
string d;
title = BB[1].name;
num = BB[2].number;
d = BB[0].date;
cout << title << endl;
cout << num<< endl;
cout<<d<<endl;
}