#include<iostream>
using namespace std;
class zoo
{
const static int age=9999;
static int res;
public:
zoo()
{
cout<<"this is zoo!" << endl;
}
class animal
{
public:
animal()
{
cout << "z.age=" << age << endl;
cout << "z.res=" << res << endl;
cout << "this is animal" << endl;
}
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
};
class person
{
public:
person()
{
cout << "this is person!" << endl;
}
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
class hand
{
public:
hand()
{
cout << "this is hand!" << endl;
}
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
};
};
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
};
int zoo::res =100000;
int main()
{
zoo xazoo;
xazoo.ShowTypeInfo ();
zoo::person ps;
ps.ShowTypeInfo ();
zoo::animal an;
an.ShowTypeInfo ();
zoo::person::hand chenbincheng;
chenbincheng.ShowTypeInfo ();
return 0;
}
using namespace std;
class zoo
{
const static int age=9999;
static int res;
public:
zoo()
{
cout<<"this is zoo!" << endl;
}
class animal
{
public:
animal()
{
cout << "z.age=" << age << endl;
cout << "z.res=" << res << endl;
cout << "this is animal" << endl;
}
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
};
class person
{
public:
person()
{
cout << "this is person!" << endl;
}
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
class hand
{
public:
hand()
{
cout << "this is hand!" << endl;
}
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
};
};
void ShowTypeInfo()
{
cout << typeid(*this).name() << endl;
}
};
int zoo::res =100000;
int main()
{
zoo xazoo;
xazoo.ShowTypeInfo ();
zoo::person ps;
ps.ShowTypeInfo ();
zoo::animal an;
an.ShowTypeInfo ();
zoo::person::hand chenbincheng;
chenbincheng.ShowTypeInfo ();
return 0;
}