#include <iostream>
#include <string>
#include <vector>
#include <memory>
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<unique_ptr<Nome>> nome;
nome.emplace_back(new SobreNome("João", "Alves"));
nome[0]->exibirNome();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8bWVtb3J5Pgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgTm9tZSB7Cglwcm90ZWN0ZWQ6CiAgICAJc3RyaW5nIG5vbWU7CiAgICBwdWJsaWM6CiAgICAgICAgTm9tZShzdHJpbmcgX25vbWUpIHsKCQkJbm9tZSA9IF9ub21lOwoJCX0KICAgICAgICB2aXJ0dWFsIHZvaWQgZXhpYmlyTm9tZSgpID0gMDsKfTsKY2xhc3MgU29icmVOb21lIDogcHVibGljIE5vbWUgewogICAgc3RyaW5nIHNvYnJlX25vbWU7CglwdWJsaWM6CgkgICAgU29icmVOb21lKHN0cmluZyBub21lLCBzdHJpbmcgX3NvYnJlX25vbWUpIDogTm9tZShub21lKSB7CgkJICAgIHNvYnJlX25vbWUgPSBfc29icmVfbm9tZTsKCQl9CgkgICAgdm9pZCBleGliaXJOb21lKCkgewoJCQljb3V0IDw8IG5vbWUgPDwgIiAiIDw8IHNvYnJlX25vbWU7CgkJfQp9OwoKaW50IG1haW4oKSB7CiAgICB2ZWN0b3I8dW5pcXVlX3B0cjxOb21lPj4gbm9tZTsKICAgIG5vbWUuZW1wbGFjZV9iYWNrKG5ldyBTb2JyZU5vbWUoIkpvw6NvIiwgIkFsdmVzIikpOwogICAgbm9tZVswXS0+ZXhpYmlyTm9tZSgpOwoJcmV0dXJuIDA7Cn0=