首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
分析以下程序的执行结果【 】。 #include <iostream. h> class S{ int A[10]; public: int &operator () (int); }
分析以下程序的执行结果【 】。 #include <iostream. h> class S{ int A[10]; public: int &operator () (int); }
admin
2013-05-30
77
问题
分析以下程序的执行结果【 】。
#include <iostream. h>
class S{
int A[10];
public:
int &operator () (int);
};
int &S: :operator() (int x) {
return A[x];
}
void main() {
S a;
int i,j;
for (i=0; i<10; i++)
a(i)=i*2;
for (i=0; i<10; i++)
cout<<a(i)<<" ";
cout<<end1; }
选项
答案
0 2 4 6 8 10 12 14 16 18
解析
转载请注明原文地址:https://kaotiyun.com/show/wnNp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若有如下程序:#include<iostream>usingnamespacesstd;ints=0;classsample{staticintn;public:sample(inti){n=i;}staticvoidadd(){
有以下程序#include<iostream>usingnamespacestd;classsample{private:intx;public:sample(inta){x=a;}frienddoublesq
有如下类定义;classAA{inta;public:intgetRef()const{return&a;}//①intgetValue()const{returna;}//②voidset(intn)const{a=n
有如下的运算符重载函数定义:doubleoperator+(inti,intk){returndouble(i+k);}但定义有错误,对这个错误最准确的描述是()。
模块化程序设计过程中,追求模块的独立性,尽量做到()。
下列函数参数默认值定义错误的是()。
对于下面程序,选项正确的是()。#include<iostream>usingnamespacestd;classpoint{public:voidsetpoint(un
下列程序写法不正确的是()。
软件工程包括三个要素,分别为方法、工具和【】。
软件危机出现于20世纪60年代末,为了解决软件危机,人们提出用【】的原理来设计软件,这就是软件工程诞生的基础。
随机试题
明末文坛最杰出的诗人是__________。明末因抗清而牺牲的少年诗人是__________。
WhenIwasabout12Ihadanenemy,agirlwholikedtopointoutmyshortcomings.Weekbyweekherlistgrew:Iwasskinny,Iw
KUB片的含义是
胞宫通过胞脉、胞络直接与
2001年,我国城镇居民家庭人均可支配收入达6860元,比1996年增长()%,年平均增长7.23%。
采用高新技术要注意国家有关部门对高新技术的要求,这些要求不包括______要求。
下列关于国家助学贷款风险补偿金管理的说法,错误的是()。
某卷烟厂(地处县城)2007年12月销售卷烟900箱,取得不含税销售额150万元。其当月应纳城建税和教育费附加为()。(卷烟比例税率为45%,定额税率为150元/箱)
在教师信息输入窗体中,为职称字段提供“教授”“副教授”“讲师”等选项供用户直接选择,最合适的控件是()。
Manyschool-busdriversinNorthAmericaassignseats,keepsuspectedbulliesclosetothefront.
最新回复
(
0
)