#include <iostream>
class MyClass
{
public:
static int classval;
void foo() {
static int val = 0;
std::cout << ++val << std::endl;
std::cout << ++classval << std::endl;
}
};
int MyClass::classval = 0;
int main(void)
{
MyClass *a = new MyClass();
MyClass *b = new MyClass();
a->foo();
b->foo();
a->foo();
b->foo();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgTXlDbGFzcwp7CiAgICBwdWJsaWM6CiAgICBzdGF0aWMgaW50IGNsYXNzdmFsOwogICAgdm9pZCBmb28oKSB7CiAgICAgICAgc3RhdGljIGludCB2YWwgPSAwOwogICAgICAgIHN0ZDo6Y291dCA8PCArK3ZhbCA8PCBzdGQ6OmVuZGw7CiAgICAgICAgc3RkOjpjb3V0IDw8ICsrY2xhc3N2YWwgPDwgc3RkOjplbmRsOwogICAgfQp9OwppbnQgTXlDbGFzczo6Y2xhc3N2YWwgPSAwOwoKaW50IG1haW4odm9pZCkKewogICAgTXlDbGFzcyAqYSA9IG5ldyBNeUNsYXNzKCk7CiAgICBNeUNsYXNzICpiID0gbmV3IE15Q2xhc3MoKTsKICAgIGEtPmZvbygpOwogICAgYi0+Zm9vKCk7CiAgICBhLT5mb28oKTsKICAgIGItPmZvbygpOwoKICAgIHJldHVybiAwOwp9Cg==