#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Nome {
protected:
string nome;
public:
Nome(string _nome) {
nome = _nome;
}
virtual void exibirNome() = 0;
};
class SobreNome : public Nome {
string sobre_nome;
public:
SobreNome(string nome, string _sobre_nome) : Nome(nome) {
sobre_nome = _sobre_nome;
}
void exibirNome() {
cout << nome << " " << sobre_nome;
}
};
int main() {
vector<Nome*> *nome = new vector<Nome*>;
Nome *n = new SobreNome("João", "Alves");
nome->push_back(n);
nome->at(0)->exibirNome();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgTm9tZSB7Cglwcm90ZWN0ZWQ6CiAgICAJc3RyaW5nIG5vbWU7CiAgICBwdWJsaWM6CiAgICAgICAgTm9tZShzdHJpbmcgX25vbWUpIHsKCQkJbm9tZSA9IF9ub21lOwoJCX0KICAgICAgICB2aXJ0dWFsIHZvaWQgZXhpYmlyTm9tZSgpID0gMDsKfTsKY2xhc3MgU29icmVOb21lIDogcHVibGljIE5vbWUgewogICAgc3RyaW5nIHNvYnJlX25vbWU7CglwdWJsaWM6CgkgICAgU29icmVOb21lKHN0cmluZyBub21lLCBzdHJpbmcgX3NvYnJlX25vbWUpIDogTm9tZShub21lKSB7CgkJICAgIHNvYnJlX25vbWUgPSBfc29icmVfbm9tZTsKCQl9CgkgICAgdm9pZCBleGliaXJOb21lKCkgewoJCQljb3V0IDw8IG5vbWUgPDwgIiAiIDw8IHNvYnJlX25vbWU7CgkJfQp9OwoKaW50IG1haW4oKSB7CiAgICB2ZWN0b3I8Tm9tZSo+ICpub21lID0gbmV3IHZlY3RvcjxOb21lKj47CiAgICBOb21lICpuID0gbmV3IFNvYnJlTm9tZSgiSm/Do28iLCAiQWx2ZXMiKTsKICAgIG5vbWUtPnB1c2hfYmFjayhuKTsKICAgIG5vbWUtPmF0KDApLT5leGliaXJOb21lKCk7CglyZXR1cm4gMDsKfQ==