网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
下列程序的执行结果是( )。 include include Class TestClass

下列程序的执行结果是( )。 #include<iostream.h> #include<stdlib.h> Class TestClass { public: int x,y; TestClass(){x=y=0;} TestClass(int a,int b){x=a;y=b;} void disp() { cout<<"x="<<x<<",y="<<y<<end1; } }; void main() { TestClass s1(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 include Class TestClass 下列程序的执行结果是( )。 #include<iostream.h> #include<stdlib.h> Class TestClass { public: int x,y; TestClass(){x=y=0;} TestClass(int a,int b){x=a;y=b;} void disp() { cout<<"x="<<x<<",y="<<y<<end1; } }; void main() { TestClass s1(2,3); s1.disp(); }A.x=2,y=2B.x=3,y=3C.x=2,y=3D.x=3,y=2 ” 相关考题
考题 下面程序的执行结果是______。 include include using namespace std; vo 下面程序的执行结果是______。include<iostream.h>include<iomanip.h>using namespace std;void main(){cout<<setfill('x')<<setw(10);cout<<"Hello"<<endl;}

考题 下列程序的执行结果是______。 include include using namespace std; vo 下列程序的执行结果是______。include<iostream.h>include<iomanip.h>using namespace std;voidmain(){cout<<setfill('x')<<setw(10);cout<<"Hello"<<end1;}

考题 以下程序的执行结果是【】。includeincludeclass Sample{ public: int x,y; 以下程序的执行结果是【 】。include<iostream.h>include<stdlib.h>class Sample{public:int x,y;Sample(){x=y=0;}Sample(int a,int b) {x=a;y=b; }void disp(){cout<<"x="<<x<<",y="<<y<<end1;}};void main() {Sample s1(2,3);s1.disp();}

考题 以下程序的执行结果是【】。 include include include int ma 以下程序的执行结果是【 】。include <iostream.h>include <fstream.h>include <stdlib.h>int main(){fstream outfile, infile;outfile.open("D:\\text.dat",ios::out);if(!outfile){cout<<"text.dat can't open"<<end1

考题 有如下程序:includeincludeusing namespace std;class TestClass{public;T 有如下程序: #include<iostream> #include<iomanip> using namespace std; class TestClass{ public; TestClass (){cout<<'A';} TestClass(char C){cout<<c;) ~TestClass (){cout<<'B';} }; int main(){ TestClass p1,*p2; p2=new TestClass('X'); delete p2; return 0; } 执行这个程序的结果是( )。A.ABXB.ABXBC.AXBBD.AXB

考题 以下程序的执行结果是_______。 include include include void 以下程序的执行结果是_______。include<iostream.h>include<fstream.h>include<stdlib.h>void main(){char ch:fstream file:file.open("abc.dat",ios::out1ios::inlios::binary);if(! file){cout<<“abc.dat文件不能打开”<<endl:abort

考题 下列程序的执行结果是()。includeincludeclass TestClass{public:intx,y 下列程序的执行结果是( )。 #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; }A.x=2,y=2B.x=3,y=3C.x=2,y=3D.x=3,y=2

考题 下列程序的执行结果是( )。 #inClude<iostream.h) #include(stdlib.h) class TestClass { public: int x,y; TestClass(){x=y=0;} TestClass(int a,int b){x=a;y=b;} void disp() { cout<<"x="<<x<<",y="<<y<<endl; } }; void main() {A.x=2,y=2B.x=2,y=3C.x=3,y=2D.x=3,y=3

考题 下列程序的执行结果是______。 include include class TestClass { publ 下列程序的执行结果是______。 #include<iostream.h> #include<stdlib.h> class TestClass { public: int x,y; TestClass () {x=y=0;} TestClass (int a,int b){x=a;y=b;} void disp() { cout<<"x="<<x<<",y="<<y<<end1; } void main() TestClass s1(2,3); s1.disp(); }A.x=2,y=2B.x=2,y=3C.x=3,y=2D.x=3,y=3