分析下列程序,写出程序运行结果____。#includeusing namespace std;class A{public:virtual void f( ){cout<<1; }void g( ){ cout<<2; }};class B: public A {public:virtual void f( ){ cout<<3; }void g( ){ cout<<4; }};void show( A &a) { a.f( ); a.g( ); }void print(A *p){ p->f(); p->g();}int main(void){B b;show(b);print(&b);cout<
分析下列程序,写出程序运行结果。#includeusing namespace std;class A{protected:static int num;public:A( ){ num++; cout<
分析下列程序,写出程序运行结果。#includeusing namespace std;class A{protected:static int num;public:A( ){ num++; cout<
分析下列程序,写出程序运行结果。#includeusing namespace std;class A{public:A(char *s){ cout<