1.  >>  高等继续教育 / 面向对象程序设计
 高等继续教育 / 面向对象程序设计
正确率:100%

【面向对象程序设计】模拟试题
#include<iostream.h>class goods{private: static int totalweight; int weight;public: goods(int w){ weight=w; totalweight+=weight; } goods(goods&gd){ weight=gd.weight; totalweight+=weight; } ~goods(){ totalweight-=weight; } static int gettotal(){ return totalweight; }};int goods::totalweight=0;void main(){ goods g1(50); cout<<goods::gettotal()<<endl; goods g2(100); cout<<G2.GETTOTAL()<<endl;}
考题内容:
#include<iostream.h>class goods{private:     static int totalweight;     int weight;public:     goods(int w){          weight=w;          totalweight+=weight;     }    goods(goods&gd){          weight=gd.weight;          totalweight+=weight;    }    ~goods(){          totalweight-=weight;    }    static int gettotal(){          return totalweight;    }};int goods::totalweight=0;void main(){     goods g1(50);     cout<<goods::gettotal()<<endl;     goods g2(100);     cout<<G2.GETTOTAL()<<endl;} 

 参考答案:
 佳题速递:
  • 离子团中,各原子的氧化数之和等于离子的电荷数 药用基础化学
  • 中国药典(一部)附录收载的砷盐检查法有( )。药物分析
  • 33、 高等数学(工专)
  • 合同自体法是()国学者首先提出来的。 国际私法学
  • 《劳动合同法》规定,劳务派遣一般实施在()。劳动与社会保障法
  • 应急事态行动中心是负责应急的官员集中工作、协调信息和资源,指挥和控制本行政区划内突发事件管理行动的场所。错误正确公共安全管理