问答题

【参考答案】

(A)int code; int english;(B)cout<<"输入编号:"; cin>>code;(C)int ......

(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)
<上一题 目录 下一题>
热门 试题

问答题
改错题使用VC6打开考生文件夹下的工程test1_1,此工程包含一个源程序文件test1_1.cpp,但该程序运行有问题,请改正main函数中的错误,使该程序的输出结果如下:Constructor called.Default constructor called.Area is 6Area is 0Area is 6源程序文件test1_1.cpp清单如下:#includeclass RectAngle{private: double ledge,sedge;public: RectAngle() { cout<< Default constructor called. n ; } RectAngle(double l,double s) { ledge=l;sedge=s; cout<< Constructor called. n ; } void Set(double l,double s) { ledge=l;sedge=s; } void Area() { cout<< Area is <<ledge*sedge<<endl; } };void main(){ ***************** found ***************** RectAngle Rect1(2,3);RectAngle Rect2(1); ***************** found ***************** RectAngle Rect3;Rect1.Area(); ***************** found ***************** Rect2.ledge=0;Rect2.sedge=0;Rect2.Area();Rect3.Area();}
相关试题
  • 简单应用题请编写函数void swap(int *p...