- 1
- 0
- 约10.44万字
- 约 199页
- 2020-05-07 发布于山东
- 举报
#includeiostream using namespace std ; class Goods { public : Goods ( int w) { weight = w ; total_weight += w ; } ~ Goods() { total_weight -= weight ; } int Weight() { return weight ; } static int TotalWeight() { return total_weight ; } Goods *next ; private : int weight ; static int total_weight ; } ; int Goods::total_weight = 0 ; void purchase( Goods * f, Goods * r, int w ) { Goods *p = new Goods(w) ; p - next = NULL ; if ( f == NULL ) f = r = p ; else { r - next = p ; r = r - next ; } } void sale( Goods * f , Goods * r ) {
原创力文档

文档评论(0)