![](https://lstatic.shangxueba.com/jiandati/pc/images/pc_jdt_tittleico.png)
下列代码声明了 3 个类 class Shape{}; class Point:public Shape{}; class Circle:Shape{}; 下列关于这些类之间关系的描述中,错误的是 _____
A.类Shape是类Point的基类
B.类Circle从类Shape公有继承
C.类Point是类Shape的派生类
D.类Circle是类Shape的派生类
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_q_ckda.png)
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_panel_vip.png)
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_q_wyda.png)
- · 有4位网友选择 C,占比40%
- · 有3位网友选择 B,占比30%
- · 有3位网友选择 A,占比30%
A.类Shape是类Point的基类
B.类Circle从类Shape公有继承
C.类Point是类Shape的派生类
D.类Circle是类Shape的派生类
A、CMyPoint p3=p1+p2;
B、operator +(p1,p2);
C、p1=p1.operator +(p2);
D、p1=p1 +(p2);
B、b
C、c
D、d
B、5,1,1
C、1,1,1
D、1,5,5
B、1
C、2
D、3
E、4
#include
#include
using std::cout;
class Point{
public:
friend double distance(const Point &p); //P距原点的距离
Point(int xx=0,int yy=0):x(xx),Y(YY){}//①
private:
int x,y;
};
double distance(const Point &p){ //②
return sqrt(P.x*P.x+P.y*P.y);
}
int main(){
Point p1(3,4);
cout$amp; return 0; //③
}
下列叙述中正确的是
A.程序编译正确
B.程序编译时语句①出错
C.程序编译时语句②出错
D.程序编译时语句③出错
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!