单选题 有如下程序: #include<iostream> using namespace std; class Goods{//货物类 double unit_price;//单价 int quantity;//数量 public: Goods(double u=0.0,int q=0):unit_price(u),quantity(q){} double getPrice()const{return unit_price;}//返回单价 int getQuantity()const{return quantity;}//返回数量 //增加数量 Goods operator+(int q)const{return Goods(unit_price,quantity+q);} }; //增加数量 Goods operator+(________){return g+q;} //输出货物信息 ostream&operator<<(ostream& os,Goods g){ cout<<"单价:"<<g.getPrice()<<','<<”数量:"<<g.getQuantity()<<endl; return os; }; int main(){ Goods g(35.6,100); cout<<g<<g+33<<25+g; return 0; } 若运行后的输出结果是: 单价:35.6,数量:100 单价:35.6,数量:133 单价:35.6,数量:125 则程序中下划线处缺失部分应该是( )。
【正确答案】 C
【答案解析】解析:程序中,语句Goods g(35.6,100);定义了Goods类的对象g,通过构造函数可知单价unit_price赋值为35.6,数量quantity赋值为100,所以cout<