C++程序设计教程第7版_2201-2420.pptxVIP

  • 1
  • 0
  • 约5.94万字
  • 约 220页
  • 2026-08-24 发布于浙江
  • 举报

intGoods::total_weight=0;

voidpurchase(Goods*f,Goods*r,intw)

{Goods*p=newGoods(WD);

p-next=NIIII.

if(f==NUGoods::Goods(intw){weight=w;total_weight+=w;}

else{r-next=p;r=r-next;}调用构造函数

累加货物重量;

intGoods:total_weight=0;

voidpurchase(Goods*f,Goods*r,intw){Goods*p=newGoods(w);

p-next=NULL;

if(f==NULL)f=r=p;

else{r-next=p;r=r-next;}

{if(f==NULL){coutNoanygoods!\n;return;}Goods*q=f;f=f-next;deleteq;;

intGoods:total

文档评论(0)

1亿VIP精品文档

相关文档