单项选择题
有以下程序 #include<iostream> using namespace std; int a; int fun(); int main() { extern int a; int b; a=100; b=fun(); cout<<b<<end1; return 0; } int fun() { extern int a; return(10*A) ; } 其程序运行后的输出结果是
A.100
B.10
C.1000
D.10000
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include<iostream> using namespace std; class Base { private: char c; piblic: Base(char n):c(n){} ~Base() { cout<<C; } }; class DeriVed:public Base { private: char c; public: Derived(char n):Base(n+1),c(n){} ~Derived() { cout<<c; } }; int main() { Derived obj(’x’); return 0; } 执行上面的程序将输出
A.xy
B.yx
C.x
D.y
点击查看答案&解析
单项选择题
若有以下程序: #include<iostream> using namespace std; class Base { public: Base() { x=O; } int x; }; Class Derived1:virtual public Base { public: Derived1() { x=10; } }; class Derived2:Virtual public Base { public: Derived2() { x=20; } }; class Derived:public Derived1,protected DeriVed2 {}; int main() { Derived obj; cout<<Obj.x<<end1; return 0; } 该程序运行后的输出结果是
A.10
B.20
C.30
D.0
点击查看答案&解析
相关试题
有如下程序: #include<iostream> usi...
有如下程序 #include<iostream> using...