更多"有如下程序:#nclude <iostream>using names"的相关试题:
[单项选择]有如下程序:#nclude <iostream>using namespace std;class Base{ public:void fun1( ) {cout << "Base/n"; }virtual void fun2( ) {cout << "Base/n"; }};class Derived: public Base{ public:void fun1( ) {cout << "Derived/n"; }void fun2( ) {cout << "Derived/n"; }} void f(Base& b) { B. fun1( ); B. fun2( ); }int main( ){Derived obj;f(obj);return 0;}
A. Base Base
B. Base Derived
C. Derived Base
D. Derived Derived
[单项选择]有如下程序:
#include <iostream>
using namespace std;
class AA
int n;
public:
AA(int k):n(k)
int get( )return n;
int get( )const return n+1;
;
int main( ) AAa(5);
const AA b(6);
cout<<
A. 执行后的输出结果是( )。 55B. 57C. 75D. 77