首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include<iostream> using namespace std; class Base{ int x; public: Base(int n=0):x(n){cout<<n;} int
有如下程序: #include<iostream> using namespace std; class Base{ int x; public: Base(int n=0):x(n){cout<<n;} int
admin
2013-02-27
9
问题
有如下程序: #include<iostream> using namespace std; class Base{ int x; public: Base(int n=0):x(n){cout<<n;} int getX( )const{return x;} }; class Derived:public Base{ int y; public: Derived(int m,int n):y(m),Base(n){tout<<m;} Derived(int m):y(m){cout<<m;} }; int main( ){ Derived dl(3),d2(5,7); return 0; } 程序的输出结果是
选项
A、375
B、357
C、0375
D、0357
答案
C
解析
有如下程序: #include<iostream> using namespace std; class Base{ int x; public: Base(int n=0):x(n){cout<<n;} int getX( )const{return x;} }; class Derived:public Base{ int y; public: Derived(int m,int n):y(m),Base(n){tout<<m;} Derived(int m):y(m){cout<<m;} }; int main( ){ Derived dl(3),d2(5,7); return 0; } 程序的输出结果是
转载请注明原文地址:https://kaotiyun.com/show/0qVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有下列程序 #include<stdio.h> voidfun(inta[],intn,intflag) { inti=0,j,t; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++)
某完全二叉树有256个结点,则该二叉树的深度为()。
以下叙述中正确的是()。
以下叙述中错误的是()。
下列给定程序中,已建立了一个带头结点的单向链表,链表中的各结点按数据域递增有序链接。函数fun的功能是:删除链表中数据域值相同的结点,使之只保留一个。请在下划线处填入正确的内容并将下划线删除,使程序得出正确的结果。注意:不得增行或删行,也不得更改程序的
数据库设计中反映用户对数据要求的模式是()。
设数据元素的集合D={1,2,3,4,5},则满足下列关系R的数据结构中为线性结构的是()。
某二叉树共有12个结点,其中叶子结点只有1个。则该二叉树的深度为(根结点在第1层)()。
在一棵二叉树上第5层的结点数最多是
随机试题
基底神经节包括
设曲线y=f(x)由参数方程处的切线方程.
处方书写中,缩写词“bid.”表示
患者,女,27岁。左上第三磨牙颊向倾斜,食物嵌塞。拟拔除。对此最常用的麻醉方法是
三棱兼治鸡血藤兼治
定喘穴位于背部,当第7颈椎棘突下,旁开
通常()情况应选用稠度较高的沥青。
有一宗房地产,假设使用年期为无限,未来第1年年纯收益为100万元,资本化率为10%,若:(1)未来各年的纯收益在上一年的基础上增加1万元;(2)未来各年的纯收益在上一年的基础上增长1%。要求:试确定两种情况下该宗房地产的评估价值各为多少。
纳税人取得下列收入,应缴纳城市维护建设税的是()。
Thispartistotestyourabilitytodopracticalwriting.Youarerequiredtowriteabusinessletteraccordingtothefollowin
最新回复
(
0
)