#include <iostream>
using namespace std;
struct Block {
int* number;
Block(){
number = new int;
}
Block(const Block &other) {
number = new int;
*number = *(other.number);
}
~Block() {
if (number != nullptr) {
delete number;
}
}
};
void function(Block block) {
cout << block.number << ": " << *(block.number) << endl;
}
int main() {
Block block;
*(block.number) = 1;
cout << block.number << ": " << *(block.number) << endl;
function(block);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IEJsb2NrIHsKCWludCogbnVtYmVyOwoJCglCbG9jaygpewoJCW51bWJlciA9IG5ldyBpbnQ7Cgl9CgkKCUJsb2NrKGNvbnN0IEJsb2NrICZvdGhlcikgewoJCW51bWJlciAgPSBuZXcgaW50OwoJCSpudW1iZXIgPSAqKG90aGVyLm51bWJlcik7Cgl9CgkKCX5CbG9jaygpIHsKCQlpZiAobnVtYmVyICE9IG51bGxwdHIpIHsKCQkJZGVsZXRlIG51bWJlcjsKCQl9Cgl9Cn07Cgp2b2lkIGZ1bmN0aW9uKEJsb2NrIGJsb2NrKSB7Cgljb3V0IDw8IGJsb2NrLm51bWJlciA8PCAiOiAiIDw8ICooYmxvY2subnVtYmVyKSA8PCBlbmRsOwp9CgppbnQgbWFpbigpIHsKCUJsb2NrIGJsb2NrOwoJKihibG9jay5udW1iZXIpID0gMTsKCWNvdXQgPDwgYmxvY2subnVtYmVyIDw8ICI6ICIgPDwgKihibG9jay5udW1iZXIpIDw8IGVuZGw7CgkKCWZ1bmN0aW9uKGJsb2NrKTsKCQoJcmV0dXJuIDA7Cn0=