#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Person
{
private:
string imie;
string nazwisko;
string pesel;
public:
Person(string imie = "", string nazwisko = "", string pesel = "")
: imie(imie), nazwisko(nazwisko), pesel(pesel) {}
string get_imie() const {
return imie;
}
string get_nazwisko() const {
return nazwisko;
}
string get_pesel() const {
return pesel;
}
string to_string() const {
return "Osoba: " + imie + " " + nazwisko + ", Pesel: " + pesel;
}
};
class Student : public Person
{
private:
string nr_indeksu;
string kierunek_studiow;
public:
Student(string imie, string nazwisko, string pesel, string nr_indeksu, string kierunek_studiow)
: Person(imie, nazwisko, pesel), nr_indeksu(nr_indeksu), kierunek_studiow(kierunek_studiow) {}
string to_string() const {
return "Student: " + get_imie() + " " + get_nazwisko() + ", Pesel: " + get_pesel() +
", Nr indeksu: " + nr_indeksu + ", Kierunek studiow: " + kierunek_studiow;
}
};
ostream& operator<< ( ostream& out, const Student& wyjscie )
{
out << wyjscie.to_string();
return out;
}
int main()
{
vector <Person*> osoby;
osoby.push_back(new Person("Jan", "Kowalski", "7423764234"));
osoby.push_back(new Student("Jan", "Kowalski", "7423764234", "74632", "Elektronika"));
Student student("Jan", "Kowalski", "75295732983", "75834", "Elektronika");
cout << student.to_string() << endl;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}