深圳罗湖区罗湖大厦的邮政编号是什么??????
#includeusing namespace std;class Goods {public: Goods(int i); void goodsOut(); int getWeight(); static int TotalWeight() {return totalWeight;}private: int weight; static int totalWeight; };int Goods::totalWeight=0;//此处先初始化啊,是初始化,就是声明一个变量是要先给个值,你//构//造函数里那不是初始化,是赋值,Goods::Goods(int i){totalWeig...全部
#includeusing namespace std;class Goods {public: Goods(int i); void goodsOut(); int getWeight(); static int TotalWeight() {return totalWeight;}private: int weight; static int totalWeight; };int Goods::totalWeight=0;//此处先初始化啊,是初始化,就是声明一个变量是要先给个值,你//构//造函数里那不是初始化,是赋值,Goods::Goods(int i){totalWeight=0;static totalWeight=i totalWeight;}void Goods::goodsOut(){static totalWeight=totalWeight-weight;}void main(){ int w; cin>>w; Goods g1(w);cout}。
收起