单项选择题

下列程序的执行结果是( )。 #include<iostream.h> #include<stdlib.h> class TestClass { public: intx,y; TestClass(){x=y=0;} TestClass(int a,int b){x=a;y=b;} void disp() { cout<<"X"="<<X<<",y="<<y<<endl; } }; void main() { TestClass sl(2,3); s1.disp(); }

A.x=2,y=2
B.x=3,y=3
C.x=2,y=3
D.x=3,y=2
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]= Hello,Test ; char*p=a; while(*p) { if(*p>=’a’&&*p<=’z’) cout<<char(*p+’A’-’a’); else cout<<*p; p++; } retum 0; }
A.hllo,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
单项选择题
下列说法中错误的是( )。
A.公有继承时基类中的public成员在派生类中仍是public成员
B.私有继承时基类中的protected成员在派生类中仍是protected成员
C.私有继承时基类中的public成员在派生类中仍是private成员
D.保护继承时基类中的public成员在派生类中仍是protected成员
相关试题
  • 有下列程序: #include<iostream> usi...
  • 有下列程序: #include<iostream> usi...
  • 有下列程序: #include<iostream.h> ...
  • 有下列的程序: #include<cstring.h>...