有以下程序 include using namespace std; class R{ public: R(int r1,int r2){R1=r 有以下程序#include <iostream>using namespace std;class R{public:R(int r1,int r2){R1=r1;R2=r2;}void print();void print()const;private:iht R1,R2;};A.5,4B.20,52C.0,0D.4,5
有以下程序 include using namespace std; class R{ public: R(int r1,int r2){R1=r
有以下程序
#include <iostream>
using namespace std;
class R
{
public:
R(int r1,int r2)
{
R1=r1;
R2=r2;
}
void print();
void print()const;
private:
iht R1,R2;
};
A.5,4
B.20,52
C.0,0
D.4,5
相关考题:
( 29 )有如下程序#include iostreamusing namespace std;class A{public:A(int i=0):r1(i) { }void print() {cout ' E ’ r1 ' - ' ;}void print() const {cout ' C ' r1*r1 ' - ' ;}void print(int x) {cout ' P ' r1*r1*r1 ' - ' ;}private:int r1;};int main() {A a1;const A a2(4);a1.print(2);a1.print();return 0;}运行时的输出结果是A ) P8-E4B ) P8-C16-C ) P0-E4-D ) P0-C16-
若有以下程序段: include using namespace std; int main() {char*p="abcdefgh",*r;l 若有以下程序段:include <iostream>using namespace std;int main(){char*p="abcdefgh",*r;long*q;q=(long*)p;q++;r=(char*)q;cout<<r<<end1;return 0;}该程序的输出结果是【 】。
有以下程序:includeusing namespace std;class A{private:int a;public:A(int i){a=i 有以下程序: #include<iostream> using namespace std; class A {private: int a; public: A(int i) {a=i;} void disp() {cout<<a<<“,”;}}; class B {private: int b; public: B(int j) {b=j;} void disp() {cout<<b<<“,”;A.10,10,10B.10,12,14C.8,10,12D.8,12,10
有如下程序: #inClude using nameSpace std; Class A{ public: A(inti=0):r1(i){ } void plint(){cout‘E’<<r1‘-’;} void print()const{cout‘C’<<r1*r1‘-’;} void print(int X){cout‘P’<<r1*r1*r1‘-’;} prlvate: intrl; }; intmain(){ Aal; constA a2(4); a1.print(2); a2.print(); returh0; } 运行时的输出结果是( )。A.P8-E4B.P8-C16-C.P0-E4-D.P0-C16-
程序的输出结果是【 】。 include using namespace std; class A{ int x; public: A(int 程序的输出结果是【 】。include <iostream>using namespace std;class A{int x;public:A(int x=1):x(x){cout<<x;}};void main(){A a,b(2),c(3);}
下列程序的输出结果是【】。 include using namespace std; int main(){int data=1;int 下列程序的输出结果是【 】。include <iostream>using namespace std;int main(){int data=1;int r = data;data+=5;r+=5;cout<<data<<end 1;return 0;}
下列程序的输出结果是______。 include using namespace std; int main() {int data=l; 下列程序的输出结果是______。include<iostream>using namespace std;int main(){int data=l;int r = data;data+=5;r+=5;cout<<data<<endl;return 0;}
有以下程序:include using namespace std; class Base { public: Base() { K=0; } int 有以下程序:include<iostream>using namespace std;class Base{public:Base(){K=0;}int x;};class Derivedl:virtual public Base{public:Derivedl(){x=10;}};class Derived2:virtua1 public Base
有以下程序:includeusing namespace std;{public:TestClass(int r1,int r2){R1=r1;R2 有以下程序: #include<iostream> using namespace std; { public: TestClass(int r1,int r2) { R1=r1; R2=r2; } void print(); void print() const; private; int R1,R2; }; void TestClass::print() { cout<<R1<<","<<R2<<end1; } void Testclass::print() const cout<<R1<<","<<R2<<end1; } int main() { TestClass a(5,4); const TestClass b(20,52); b.print(); return 0; } 执行后的输出结果是( )。A.5,4B.20,52C.0,0D.4,5
有以下程序:includeusing namespace std;class R{ public: R(int r1,int r2) {R1=r1; 有以下程序: #include<iostream> using namespace std; class R { public: R(int r1,int r2) { R1=r1; R2=r2; } void print(); void print()const; private: int R1,R2; }; void R::print() { cout<<R1<<","<<R2<<end1; } void R::print()const { cout<<R1<<","<<R2<<end1; } int main() { R a(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是( )。A.5,4B.4,5C.20,52D.52,20
有以下程序 include using namespace std; class Base { int a; public: Base(int x) 有以下程序include <iostream>using namespace std;class Base{int a;public:Base(int x){ a=x; }void show(){ cout<<a; }class Derived : public Base{int b;public:Derived(int i) :Base(i+1),b(i){}void show() { cout<<b;};int main (){Base b(5),*pb;Derived d(1);pb=d;pb->show ();return 0;}运行后的打印结果是______。
有以下程序:includeusingnamespacestd;definePI3.14classPoint{private: intx,y;pub 有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int b) { x=a; y=b; } int getx() { return x; } int gety() { return y; } }; class Circle : public Point { private: int r; public: Circle(int a,int b,int c):Point(a,b) { r=c; } int getr() { return r; } double area() { return PI*r*r; } }; int main() { Circle c1(5,7,10); cout<<cl.area()<<endl; return 0; } 程序执行后的输出结果是A.314B.157C.78.5D.153.86
下面程序的输出结果是【】。 include using namespace std; class A {int a,b; public:A 下面程序的输出结果是【 】。include <iostream>using namespace std;class A{int a, b;public:A(){a = b = 0;}A(int aa, int bb ) : a(aA) , b(bB){cout <<"a="<<a<<","<<"b="<<b<<",";}~A(){cout<<"D";};int main ( ){A x, y(2, 3);return 0;}
有以下程序:includeusing namespace std;class R{public:R(int r1,int r2){R1=rl;R2= 有以下程序: #include<iostream> using namespace std; class R { public: R(int r1,int r2) { R1=rl; R2=r2; } void print(); void print()const; private: int R1,R2; }; void R::print() { cout<<R1<<","<<R2<<end1; } void R::print() const { cot<<R1<<","<<R2<<end1; } int main() { Ra(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是A.5,4B.20,52C.0,0D.4,5
将下面程序补充完整。 include using namespace std; class Base{ public: 【 】fun(){r 将下面程序补充完整。include <iostream>using namespace std;class Base{public:【 】 fun(){return 0;} //声明虚函数};class Derived:public Base{public:x,y;void SetVal(int a,int b){}int fun(){return x+y;}};void 【 】 SetVal(int a,int b){x=a;y=b;} //类Derived成员函数void main(){Derived d;cout<<d.fun()<<endl;}
下面程序执行的结果是【 】 include using namespace std; class A{ public: static in 下面程序执行的结果是【 】include<iostream>using namespace std;class A{public:static int x;A(inty){cout<<x+y;}};int A::x=2;void main(){A a(5);}
有以下程序:includeusing namespace std;definePl 3.14Class Point{private:int x,y 有以下程序: #include<iostream> using namespace std; #definePl 3.14 Class Point {private: int x,y; public: Point(int a,intB) {X=a; y:b;} int getx() <return x;} int gety() {return y;}}; class Circle:public Point {priA.314B.157C.78.5D.153.86
有以下程序:include using namespace std;int s=0;class sample{ static int n;publi 有以下程序: #include <iostream> using namespace std; int s=0; class sample { static int n; public: sample (int i) { n=i; } static void add() { s+=n; } }; int sample::n=0;A.2B.5C.7D.3
有以下程序:includeusing namespace std;class R{public:R(int r1,int r2){R1=r1;R2= 有以下程序: #include<iostream> using namespace std; class R { public: R(int r1,int r2) { R1=r1; R2=r2; } void print(); void print0const; private: int R1,R2; }; void R::print() { cout<<R1<<","<<R2<<endl; } void R::print() const { cout<<Rl<<","<<R2<<endl; } int main() { R a(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是( )。A.5,4B.20,52C.0,0D.4,5
以下程序执行后的输出结果是include using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定
有以下程序;include using namespace std;class R{public:R(int r1,int r2){R1=r1;R2 有以下程序; #include <iostream> using namespace std; class R { public: R(int r1,int r2) { R1=r1; R2=r2; } void print(); void print () const; private: int R1, R2; }; void R::print () { cout<<R1<<","<<R2<<endl; } void R::print() const { cout<<R1<<", "<<R2<<endl; } int main () { R a(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是A.5,4B.20,52C.0,0D.4,5
有以下程序:include using namespace std;class R{public: R(int f1,int r2) {R1=r1; 有以下程序: #include <iostream> using namespace std; class R { public: R(int f1,int r2) { R1=r1; R2=r2; } void print(); void print ()const; private: int R1, R2; }; void R: :print() { cout<<R1<<", "<<R2<<end1; } void R: :print() const { cout<<Rl<<", "<<R2<<end1; } int main () { R a(5,4); const R b(20,52); b.print (); return 0; } 执行后的输出结果是A.5,4B.20,52C.0,0D.4,5
若有以下程序:include using namespace std;define PI 3.14class Point{private: in 若有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int b) { x=a; y=b; } int getx() { return x; } int gety() { return y; } }; class Circle : public Point { private: int r; public: Circle(int a, int b,int c) :Point(a,b) { r=c; } int getr() { return r; } double area() { return PI*r*r; } }; int main() { Circle c1(5,7,10); cout<<c1.area()<<end1; return 0; } 程序执行后的输出结果是( )。A.314B.157C.78.5D.153.86
听力原文:[解析] 有以下程序:includeusing namespace Std;Class R{public:R(int r1,i 听力原文:[解析]有以下程序: #include<iostream> using namespace Std; Class R {public: R(int r1,int r2) {R1=r1; R2=r2;} void print(); void print()const; private: int R1,R2;}; roid R::print() {cout<<R1<<“,”<<R2<<endl;} void R::print()conA.5,4B.20,52C.0,0D.4,5
有下列程序:includeUsing namespace std;Class Amount{ int amount;public; Amount(i 有下列程序: #include<iostream> Using namespace std; Class Amount{ int amount; public; Amount(int n=O):amount(n){} Int getAmount()const{return amount;} Amount operator+=(AmountA) {A.*thisB.thisC.amountD.amount
有下列程序:includeusing namespace std;class TestClass{int a;public:TestClass(in 有下列程序: #include<iostream> using namespace std; class TestClass { int a; public: TestClass(int x)<a=x;} void show(){cout<<a;} }; class TestClass1:publicTestClass { int b; public: TestClaA.5B.1C.0D.2
有以下程序:include using namespace std;define PI 3.14class Point{ private:int 有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int b) { x=a; y=b; } int getx() { return x; }A.314B.157C.78.5D.153.86