#include <iostream>
using namespace std;
class Contador{
public:
Contador(int c = 0) { contador = c; };
int getContador() { return contador; };
Contador& operator++() {
++contador;
return *this;
};
private:
unsigned int contador;
};
int main() {
Contador c1, c2, c3;
++c1;
++c2;
++c2;
++c2;
c3 = ++c2;
++(++(++c1));
cout << "c1: " << c1.getContador() << endl;
cout << "c2: " << c2.getContador() << endl;
cout << "c3: " << c3.getContador() << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQ29udGFkb3J7CiAgICBwdWJsaWM6CiAgICAgICAgQ29udGFkb3IoaW50IGMgPSAwKSB7IGNvbnRhZG9yID0gYzsgfTsKICAgICAgICBpbnQgZ2V0Q29udGFkb3IoKSB7IHJldHVybiBjb250YWRvcjsgfTsKICAgICAgICBDb250YWRvciYgb3BlcmF0b3IrKygpIHsKICAgICAgICAgICAgKytjb250YWRvcjsKICAgICAgICAgICAgcmV0dXJuICp0aGlzOwogICAgICAgIH07CiAgICBwcml2YXRlOgogICAgICAgIHVuc2lnbmVkIGludCBjb250YWRvcjsKfTsKCmludCBtYWluKCkgewogICAgQ29udGFkb3IgYzEsIGMyLCBjMzsKICAgICsrYzE7CiAgICArK2MyOwogICAgKytjMjsKICAgICsrYzI7CiAgICBjMyA9ICsrYzI7CiAgICArKygrKygrK2MxKSk7CiAgICBjb3V0IDw8ICJjMTogIiA8PCBjMS5nZXRDb250YWRvcigpIDw8IGVuZGw7CiAgICBjb3V0IDw8ICJjMjogIiA8PCBjMi5nZXRDb250YWRvcigpIDw8IGVuZGw7IAogICAgY291dCA8PCAiYzM6ICIgPDwgYzMuZ2V0Q29udGFkb3IoKSA8PCBlbmRsOyAKfQ==