题目内容

读程序,写结果#includeusingnamespacestd;classA{public:virtualvoidf(){cout<<"A"; };};classB:publicA{public:voidf(){cout<<"B";}};classC:publicB{public:voidf(){cout<<"C";}};intmain(){A*p,a;Bb;C c;a=b;a.f();a=c;a.f();p=&b;p->f();p=&c;p->f();return 0;}

查看答案
更多问题

读程序写结果#includeusing namespace std;class A{public:A(int i=0){ a = i ;cout<<”A”<

读程序 写结果#include using namespace std;class point{ public:static void showNumber(){ cout<

读程序写结果#includeusing namespace std;class A{ public:A(){ a=0; cout<<"A"<

读程序 写结果# include using namespace std;class A{public:A(int i) {n=i;}A(const A& a){ n=a.n; cout<<"A";}~A(){ cout<<"B"; }int get() { return n; }private:int n;};void f(A obj){ /*空函数体*/ }int main(){ A a1(3);A a2=a1;f(a1);return 0;}

答案查题题库