面向对象程序设计期末考试
static int totalweight;
public:
Goods(char *str,int w){
strcpy(gd_name,str);
weight=w;
totalweight+=weight;
}
~Goods(){totalweight-=weight;}
char * GetN(){ ⑴ ;}
int GetW(){return weight;}
static int GetTotal_weight(){
⑵ ;
}
};
⑴cout<<gd_name<<endl ⑵return totalweight