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

有以下程序:#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.输出结果不确定

答案
查看答案
更多“有以下程序:#include<iostream>using namespace std;class MyClass{public: MyClass(); ~MyClass”相关的问题

第1题

有以下程序: #include<string.h> #include<iostream.h> void main() { char * p="abcde\0fghjik\0"; cout < < strlen(p) ;} 程序运行后的输出结果是

A.12

B.15

C.6

D.5

点击查看答案

第2题

有以下程序:#include<stdio.h>#define X 5+6main(){int a=2,c;C=X*2:printf("%d",C);}程序运行后

有以下程序: #include<stdio.h> #define X 5+6 main() {int a=2,c; C=X*2: printf("%d",C); } 程序运行后的输出结果是()。

A.17

B.22

C.16

D.11

点击查看答案

第3题

有以下程序: #include<stdio.h> main() { int y=9; for(;y>0;y--) f(y%3==0)printf("%d",--y); } 程序的运行结果是()。

A.741

B.963

C.852

D.875421

点击查看答案

第4题

有以下程序#include<stdio.h>void main(){int a=1,b=0;printf("%d,",b=(a++)+(a++));pfintf("%d\

有以下程序 #include<stdio.h> void main() { int a=1,b=0; printf("%d,",b=(a++)+(a++)); pfintf("%d\n",a+B); } 程序运行后的输出结果是()。

A.4,6

B.2,5

C.3,5

D.2,6

点击查看答案

第5题

(21 )有以下程序# include (stdio.h >main (){ int a = l ; b = 2 ;for (; a < 8 ; a++ ) { b

(21 )有以下程序

# include (stdio.h >

main ()

{ int a = l ; b = 2 ;

for (; a < 8 ; a++ ) { b+=a ; a+=2 ; }

printf (" %d , %d \ n ", a , b ) ;

}

程序运行后的输出结果是

A ) 9 , 18

B ) 8 , 11

C ) 7 , 11

D ) 10 , 14

点击查看答案

第6题

有以下程序 #include<stdio.h> void WriteStr(char*fn,char*str) {FILE*fp; fp=f

有以下程序 #include<stdio.h> void WriteStr(char*fn,char*str) {FILE*fp; fp=fopen(fn"w");fputs(str,fp);fclose(fp); } main() { WriteStr("t1.dat"start"); WriteStr("t1,dat","end"); } 程序运行后,文件t1.dat中的内容是 ______。

A.start

B.end

C.startend

D.endrt

点击查看答案

第7题

‎有以下程序‎#include‎void main()‎{ int a,b,d=25;‏a=d/10%9;‏b=a&&(-1);‏printf("%d,%d/n",a,b);}‎程序运行后的输出结果是()。

A.2,1

B.2,0

C.3,1

D.6,1

点击查看答案

第8题

(29 )有以下程序# include (stdio.h )main (){ int a[5]= { 1 , 2 , 3 , 4 , 5 } , b[5] ={ O

(29 )有以下程序

# include (stdio.h )

main ()

{ int a[5]= { 1 , 2 , 3 , 4 , 5 } , b[5] ={ O , 2 , 1 , 3 , 0 } , i , s = 0 ;

for (i = 0 ; i < 5 ; i++ ) s = s+a[b[i] ] ) ;

printf (" %d \ n ", s ) ;

}

程序运行后的输出结果是

A ) 6

B ) 10

C ) 11

D ) 15

点击查看答案

第9题

有以下程序#includemain(){int y=9 ;for( ; y>0 ; y--)if(y%3==0 ) printf("%d" ,
有以下程序#includemain(){int y=9 ;for(; y>0 ; y--)if(y%3==0 ) printf("%d" ,

有以下程序

#include

main()

{

int y=9 ;

for(; y>0 ; y--)

if(y%3==0 ) printf("%d" , --y) ;}

程序的运行结果是_____

点击查看答案

第10题

有以下程序 #include<stdio.h> main() {int y=9; for(;y>0;y--) if(y%3==0)printf("%d",--y); } 程序的运行结粜是()。

A.741

B.963

C.852

D.875421

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

1. 搜题次数扣减规则:

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

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

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

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

订单号:

遇到问题请联系在线客服

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