#include <iostream.h>
class goods{
private:
static int totalWeight;
int weight;
public:
goods(int w)
{
weigh=w;
totalWeight+=w;
}
goods(goods& gd)
{
weight=gd.weight;
totalWeight+=weight;
}
~goods()
{
totalWeight-=weight;
}
int getwg()
{
return weight;
}
static int getTotal()
{
return totalWeight;
}
};
int goods::totalWeight=0;
int main()
{
int w;
cout<<"The initial weight of goods:"<<goods::getTotal()<<endl;
cin>>w; //输入25
goods g1(w);
cin>>w; //输入60
goods g2(w);
cout<<"The total weight of goods:"<<goods::getTotal()<<endl;
return 0;
}