题目
阅读以下程序: #include<iostream.h> voi6 main() { static int a[][2]={5,3,1,2}; int i,j,s1=0; for(i=0;i<2;i++) for(j=0;j<2;j++) { if(i==j) s1=s1+a[i][j]; } cout<<s1<<end1; } 则该程序的输出结果为()。
A.6
B.7
C.8
D.9
第1题
若有以下程序: #include <iost ream> using namespace std; class A { private: int a; public: A(int i) { a=i; } void disp () { cout<<a<<", "; } }; class B { private:
A.10,10,10
B.10,12,14
C.8,10,12
D.8,12,10
第2题
有如下程序: #include<iost earn> using namespace std; class TestClass{ protected: TestClass(){cout<<'x';} TestClass(char C) {cout<<c;} }; class TestClass1:public TestClass { public: TestClass1(char C) {Cout<<c;) }; int main(){ TestClass1 d1('y'); return 0; } 执行这个程序,屏幕上将显示输出()。
A.y
B.yx
C.xy
D.yy
第3题
第4题
第5题
阅读以下程序 #include<iostream.h> void main() { charline[10]; in>>line; cout<<line<<endl; } 如运行时输入This is an example.<CR>,则程序的输出结果是()。
A.This
B.This is
C.This is a
D.This is an example.
第6题
第7题
阅读以下程序
#include(iostream.h>
voidmain()
{
charline[10];
cin>>line;
cout<<1ine<<endl;
}
如运行时输入“Thisisanexample.<CR>”,则程序的输出结果是()。
A.This
B.Thisis
C.Thisisa
D.Thisisanexample
第8题
第9题
第10题
第11题
阅读以下程序
#include<iostream.h>
void main()
{
char line[10];
cin>>line;
cout<<line<<endl;
}
如运行时输入This is example.<CR>,则程序的输出结果是
A.This
B.This is
C.This is a
D.This is an example.
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!