首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下列说明和C++代码,回答问题。 [说明] 已知下列程序运行时的输出应为: 1:1 1:1 1:1 [C++程序] 01 #include <iostream> 02 using namespace
阅读下列说明和C++代码,回答问题。 [说明] 已知下列程序运行时的输出应为: 1:1 1:1 1:1 [C++程序] 01 #include <iostream> 02 using namespace
admin
2012-04-11
20
问题
阅读下列说明和C++代码,回答问题。
[说明]
已知下列程序运行时的输出应为:
1:1
1:1
1:1
[C++程序]
01 #include <iostream>
02 using namespace std;
03 class stick{
04 protect;
05 _________ {};
06 Stock(int n, int pr=1) {
07 shares=n; share_val=pr;
08 };
09 void~stock( ) {};
10 public:
11 //成员函数
12 void output( ){
13 ________ <<shares<<":"<<share val<<endl;
14 }
15 private:
16 //成员变量
17 int shares;
18 int share_val;
19 };
20
21 void main( ){
22 Stock a(1); a. output( );
23 Stock b; b. output( );
24 Stock C=Stock( ); c.output( );
25 }
请补齐上述代码中的空缺(1)和(2)。
_____
_____
选项
答案
Stock( ):shares(1),share_val(1)或Stock( ):share_val(1),shares(1)。 Cout
解析
转载请注明原文地址:https://kaotiyun.com/show/GbVZ777K
本试题收录于:
程序员上午基础知识考试题库软考初级分类
0
程序员上午基础知识考试
软考初级
相关试题推荐
(38)是测量一条UTP链路中从一对线到另一对线的信号耦合。
在100BaseTX网络中,若两台DTE设备之间使用了2台交换机,则两台DTE之间的最大跨距为(52)。
IEEE802.3u标准中使用的媒体访问控制方式是(50)。
站点首页最常用的文件名是(41)。
下列关于电子邮件的叙述不正确的是(45)。
A small network may only connect two computers inside a home to share, a single printer and Internet(74).
在MIB-2功能组的接口组中,如果对象ifAdminStatus的值为up(1),而ifOperStatus的值为down(2),则该接口处于(62)状态。
A typical application of this(71)is ADSL. It is emerging as the technology for home-and small-office Internet connectivity. It p
在寄存器间接寻址中,若指令指定的寄存器是BX、SI、或者DI,则默认操作数存放在(46)段中。这时要用寄存器(47)的内容作为段地址。对于指令MOVBX,[SI],假设数据段寄存器DS=1000H,代码段寄存器CS=4000H,堆栈段寄存器SS=7000
在HTML的bead元素内,位于title开闭标签之内的文本都会在浏览器的(31)和Windows系统的任务栏上显示。
随机试题
Nowadaysnaturalgas,windandotherformsof______arewidelyusedinthecountry.
深龋的临床表现应除外
建设项目和单项工程造价资料中应该包括()。
细水雾灭火系统管网吹扫要求:采用压缩空气或氮气吹扫,吹扫压力不大于管道的设计压力,吹扫气体流速不小于()m/s。
下列选项中,说法正确的是()。
下列各项中,属于经常项目外汇收入的是()。
基金按投资目标分类,包括的类型有()。
设f(x)在[0,+∞)内二阶可导,f(0)=-2,f′(0)=1.f″(x)≥0.证明:f(x)=0在(0,+∞)内有且仅有一个根.
关系代数运算是以______为基础的运算。
Historically,______mainmaterialformakingtableshasbeenwood,but______metalandstonehavealsobeenused.
最新回复
(
0
)