重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 计算机类考试> 计算机等级考试
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[单选题]

有以下程序: Class Date { public: Date(int y,int m,mt d); { year=y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date &D) { year=d.year; month=d.month; day=d.day; } Void prin

A.2

B.3

C.4

D.5

答案
查看答案
更多“有以下程序:Class Date{public:Date(int y,int m,mt d);{year=y;month=m;day=d;}Date(int y=2000”相关的问题

第1题

有以下类定义 clas sMyClass { public: My Class() { cout<<1;} }; 则执行

有以下类定义 clas sMyClass { public: My Class() { cout<<1;} }; 则执行语句MyClassa,b[2],*p[2];后,程序的输出结果是

A.11

B.111

C.1111

D.11111

点击查看答案

第2题

有以下程序:#include<iostream>using namespace std;#definePl 3.14Class Point{private:int x,y

有以下程序: #include<iostream> using namespace std; #definePl 3.14 Class Point {private: int x,y; public: Point(int a,intB) {X=a; y:b;} int getx() <return x;} int gety() {return y;}}; class Circle:public Point {pri

A.314

B.157

C.78.5

D.153.86

点击查看答案

第3题

有以下程序#include<iostream> using namespace std;class Complex{public: Complex(double r=O,

有以下程序 #include<iostream> using namespace std; class Complex { public: Complex(double r=O,double i=0):re(r),im(i){} double real() const {return re;} double imag()const {return im;} Complex operator +(Complex C) const {return Complex (re+c.re,im+c.im);} private: double re,im; }; int main() { Complex a=Complex(1,1)+Complex (5); cout<<a.real()<<'+'<<a.imag()<<'i'<<endl; retum 0; } 程序执行后的输出结果是

A.6+6i

B.6+1i

C.1+6i

D.1+1i

点击查看答案

第4题

有以下程序:#include<iostream>using namespace std;class MyClass{public: MyClass(); ~MyClass

有以下程序: #include<iostream> using namespace std; class MyClass { public: MyClass(); ~MyClass(); void SetValue(int val); private: static int i; }; int MyClass::i=0; MyClass::MyClass() { i++; cout<<i; } MyClass::~MyClass() { i--; cout<<i; } void MyClass::SetValue(int val) { i=val; } int main() { MyClass*my[2]; int k; for(k=0;k<2;k++) my[k]=new MyClass; for(k=0;k<2;k++) delete my[k]; return 0; } 运行后的输出结果是()。

A.1210

B.1100

C.1234

D.输出结果不确定

点击查看答案

第5题

有以下程序: public class ConstOver { public ConstOver (int x, int y, int z) { } } 下面

A.protected int ConstOver (){ }

B.private ConstOver (int z, int y, byte x) { }

C.public object ConstOver (int x, int y, int z) { }

D.public void ConstOver (byte x, byte y, byte z) { }

点击查看答案

第6题

以下Java程序的运行结果是()。public class Increment{public static void main(String args[]

A. 222

B. 233

C. 223

D. 345

点击查看答案

第7题

以下程序中,错误的行为①#include < iostream.h >②class A③{④public:⑤int n=2;⑥A(int val){cout <

以下程序中,错误的行为 ①#include < iostream.h > ②class A ③{ ④ public: ⑤ int n=2; ⑥ A(int val){cout << val<<end1;} ⑦ ~A(0{}; ⑧}; ⑨void main(0 ⑩{ (11) Aa(0); (12)

A.⑤

B.⑥

C.⑦

D.(11)

点击查看答案

第8题

给出以下代码,该程序的运行结果是()class Example {public static void main (String args[])

A.-1

B.Exception

C.1

D.0

点击查看答案

第9题

以下程序中,错误的行为① #include<iostream.h>② class A③ {④ public:⑤ int n=2;⑥ A(int val) {cout < < val < < endl;}⑦ ~A() {};⑧ };⑨ void main()⑩ {(11) A a (0) ;(12) }

A.⑤

B.⑥

C.⑦

D.⑩

点击查看答案

第10题

下面的程序输出结果是: ()。public class A extends B {undefinedint k = 20;public static voi

A.i=20

B.程序有编译错误

C.i=10

D.i=true

点击查看答案

第11题

有如下程序: #include<iostream> using namespace std; class A { public:
A(){cout<<"A";} }; class B<public:B(){cout<<"B";)); class C:public A { B b; public: C(){cout<<"C";} }; int main(){Cobj;retum 0;} 执行后的输出结果是

A.CBA

B.BAC

C.ACB

D.ABC

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝