首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include<iostream> using namespace std; class Point{ int x, y; public: Point(int x1=0, int y1=0):x(x1),
有如下程序: #include<iostream> using namespace std; class Point{ int x, y; public: Point(int x1=0, int y1=0):x(x1),
admin
2017-10-17
55
问题
有如下程序:
#include<iostream>
using namespace std;
class Point{
int x, y;
public:
Point(int x1=0, int y1=0):x(x1), y(y1){}
int get(){return x+y;)
};
class Circle{
Point center;
int radius;
public:
Circle(int CX, int cy, int r):center(cx, cy), radius(r){}
int get(){return center. get()+radius;}
};
int main(){
circle c(3, 4, 5);
cout<<c. get()<<end1;
return ():
}
运行时的输出结果是( )。
A) 5
B) 7
C) 9
D) 12
选项
A、
B、
C、
D、
答案
D
解析
转载请注明原文地址:https://kaotiyun.com/show/APAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若有以下定义和语句 int a=4,b=3,*p, *q, *w; p=&a; q=&b; w=q; q=NULL; 则以下选项中错误的语句是
关于常成员函数,下列说法中错误的是
C++定义了类库实现数据的输入和输出,______为根基类。
栈通常采用的两种存储结构是()
若有以下程序:#inclcude<iostream.h>voidmain(){inti;inta[3][3]={’1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’);for(i=0;
下面程序的输出结果是()#include<iostream>usingnamespacestd;intmain(){ints:for(intk=2;k<6;k+=2){s=1;
在程序设计阶段应该采取________和逐步求精的方法,把一个模块的功能逐步分解,细化为一系列具体的步骤,进而用某种程序设计语言写成程序。
在重载一个运算符为成员函数时,其参数表中没有任何参数,这说明该运算符是()。
类模板template<classT>classx{…},其中,友元函数f对特定类型T(如int),使函数f(x<int>&=成为x<int>模板类的友元,则其说明为()。
下列字符串中,正确的C++标识符是()。
随机试题
在数据流程图的分层结构中,不考虑内部处理和存储的层次是()
关于就业的说法正确的是()
期望值
简述亚临床性肝性脑病的临床表现和常用诊断方法。
A.广泛前壁心肌梗死B.高侧壁心肌梗死C.前侧壁心肌梗死D.下壁心肌梗死E.心内膜下心肌梗死三度房室传导阻滞多见于
企业常用的定价方法主要有成本导向定价法、市场需求导向定价法和()。
对于商品霉腐的防治方法主要包括()。
关于公法和私法,下列说法正确的有
Acoeducational(男女合校的)schoolofferschildrennothinglessthanatrueversionofsocietyinminiature(缩影).Boysandgirlsare
A、Samknowssomethingaboutlaw.B、Samknowshowtorepairdishwashers.C、SamisfamiliarwithMs.Corners.D、Samisgoodatper
最新回复
(
0
)