#include <string>
#include <vector>
#include <memory>
using namespace std;
class Botao {
private:
string nome;
public:
Botao(string texto) {
nome = texto;
}
};
class Caixa {
private:
vector<shared_ptr<Botao>> botoes;
public:
void addBotao(shared_ptr<Botao> botao) {
botoes.push_back(botao);
}
shared_ptr<Botao> getBotao(int i) {
return botoes[i];
}
};
int main() {
auto caixa1 = Caixa();
auto botao1 = make_shared<Botao>("clique");
caixa1.addBotao(botao1);
return 0;
}
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPG1lbW9yeT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIEJvdGFvIHsKcHJpdmF0ZToKICAgc3RyaW5nIG5vbWU7CnB1YmxpYzoKICAgQm90YW8oc3RyaW5nIHRleHRvKSB7CiAgICAgIG5vbWUgPSB0ZXh0bzsKICAgfQp9OwoKY2xhc3MgQ2FpeGEgewpwcml2YXRlOgogICB2ZWN0b3I8c2hhcmVkX3B0cjxCb3Rhbz4+IGJvdG9lczsKcHVibGljOgogICB2b2lkIGFkZEJvdGFvKHNoYXJlZF9wdHI8Qm90YW8+IGJvdGFvKSB7CiAgICAgIGJvdG9lcy5wdXNoX2JhY2soYm90YW8pOwogICB9CiAgIHNoYXJlZF9wdHI8Qm90YW8+IGdldEJvdGFvKGludCBpKSB7CiAgICAgIHJldHVybiBib3RvZXNbaV07CiAgIH0KfTsKCmludCBtYWluKCkgewogICBhdXRvIGNhaXhhMSA9IENhaXhhKCk7CiAgIGF1dG8gYm90YW8xID0gbWFrZV9zaGFyZWQ8Qm90YW8+KCJjbGlxdWUiKTsKICAgY2FpeGExLmFkZEJvdGFvKGJvdGFvMSk7CiAgIHJldHVybiAwOwp9