#include <iostream>
class Foo {
int myindex;
static int c;
public:
Foo() {
myindex = c++;
}
int getMynum() {
return myindex;
}
};
int Foo::c = 0;
int main() {
Foo arg[10];
std::cout << arg[7].getMynum() << std::endl;
std::cout << arg[5].getMynum() << std::endl;
std::cout << arg[3].getMynum() << std::endl;
return 0;
}
/* end */
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgRm9vIHsKICBpbnQgbXlpbmRleDsKICBzdGF0aWMgaW50IGM7CnB1YmxpYzoKICBGb28oKSB7CiAgICBteWluZGV4ID0gYysrOwogIH0KICBpbnQgZ2V0TXludW0oKSB7CiAgICByZXR1cm4gbXlpbmRleDsKICB9Cn07CmludCBGb286OmMgPSAwOwoKaW50IG1haW4oKSB7CiAgRm9vIGFyZ1sxMF07CiAgc3RkOjpjb3V0IDw8IGFyZ1s3XS5nZXRNeW51bSgpIDw8IHN0ZDo6ZW5kbDsKICBzdGQ6OmNvdXQgPDwgYXJnWzVdLmdldE15bnVtKCkgPDwgc3RkOjplbmRsOwogIHN0ZDo6Y291dCA8PCBhcmdbM10uZ2V0TXludW0oKSA8PCBzdGQ6OmVuZGw7CiAgcmV0dXJuIDA7Cn0KLyogZW5kICovCgo=