A.15
B.20
C.25
D.30
[单选题]若有以下程序: #include 〈iostream〉 using namespace std; class sample { private: int n; public: sample(){} sample(int m) { n=m; } void addvalue(int m) { sample s; s.n=n+m; *this=s; } void disp() { cout〈〈"n="〈〈n〈〈end1; } }; int main() { sample s(10); s.addv
[单选题]若有以下程序: #include 〈iostream〉 using namespace std; class A { private: int x; public: int z; void setx(int i) { x=i; } int getx () { return x; } }; class B : public A { private: int m; public: int p; void setvalue(int a,int b, int C) { setx (A) ; z=b; m
[单选题]若有以下程序: #include〈iostream〉 using namespace std; int main() { int data[4],i,j,temp; for (i=O; i<4; i++) cin>>data[i]; for (i=1; i<4; i++) { j = i-1; temp = data[i]; while (data [j ] >temp&&j >=0) { data[j+1] = data[j]; j--; }
[单选题]有如下程序 include include using namespace std; cla有如下程序 #include <iostream> #include <iomanip> using namespace std; class MyClass { public: MyClass() { cout<<'A'; } MyClass(char c){ cout<<c; } ~MyClass(){ cout<<'B'; } }; int main( ) { MyClass p1,*p
[单选题]有以下程序: #include 〈iostream〉 using namespace std; class A { public: virtual void setx(int i,int j=0) { x=i; y=j; } virtual void print()=0; protected: int x,y; }; class B : public A { public: void print() { cout〈〈x*x〈〈", "; } }; class C : public A { p
[单选题]有以下程序: #include 〈iostream〉 using namespace std; #define M 10 #define B4 void setstar(char *a, int n) { int i; for (i=0; iA.AB C D E F G H I JB.AB C D * * * * * *C.AB C D E F * * * *D.* * * * * * A B C D
[单选题]有如下的程序: include include using namespace st有如下的程序: #include<cstring> #include<iostream> using namespace std; class MyString { public: MyString(const char*s); ~MyString(){delete[]data;} Protected: unsigned len; char*data; }; MyString::MyString(const ch
[单选题]有下列的程序: include include using namespace std; cl有下列的程序: #include<cstring.h> #include<iostream.h> using namespace std; class MyString { public: MyString(const char*s); ~MyString(){delete[]data;} protected: unsigned len; char*data; }; MyString::MyString
[单选题]有如下程序: #include(iostream) using namespace std; class TestClass{ protected: TestClass(){couti(cout<<‘x’;} TestClass(char c){cout<<c;}}; class TestClassl:publicTestClass{ public: TestClassl(char c){cout<<c;}}; int main(){ TeA.yB.yxC.xyD.yy
[主观题]若有以下程序: include using namespace std; class sample { int x; public: sample若有以下程序:include <iostream>using namespace std;class sample{int x;public:sample(){}void setx(int i){x=i;}friend iht fun(sample B[],int n){int m=0;for{int i=0;i<n;i++)if(B[i].x>m)