#include "iostream"
using namespace std;
class Width
{
private:
static int count2;//私有静态成员
public:
static int count1;//公有静态成员
int numWidths1()//普通成员函数
{
return count2;
}
static int numWidths2()//静态成员函数
{
return count2;
}
Width()//构造函数
{
count1++;
count2++;
}
Width(Width &W)//拷贝构造函数
{
count1++;
count2++;
}
~Width()//析构函数
{
count1--;
count2--;
}
};
int Width:: count1=0;
int Width:: count2=0;//静态数据成员初始化
int main()
{
Width w1;
Width w2[3];
cout<
}//主函数仅用作测试