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