有如下程序段: Const c$="Beijing" c$="Shanghai" c$="Hebei" Print c¥运行时输出的结果是( )。A.BeijingB.ShanghaiC.HebeiD.显示出错信息
有如下程序段: Const c$="Beijing" c$="Shanghai" c$="Hebei" Print c¥运行时输出的结果是( )。
A.Beijing
B.Shanghai
C.Hebei
D.显示出错信息
相关考题:
( 28 )有如下程序#include iostreamusing namespace std;class A {public:A(int i):rl(i) {}void print() {cout'e'r1'-';}void print() const {cout'C'rl*rl'-';}private:int rl;};int main(){A al(2); const A a2(4);Al.print();a2.print();Return 0;}运行时的输出结果是A )运行时出错B ) E2-C16-C ) C4-C16-D ) E2-E4-
( 13 )有如下程序:#include iostreamusing namespace std;class GrandChild{public:GrandChild(){ strcpy (name,"Unknown"); }const char * getName()const { return name; }virtual char * getAddress()const=0;private:char name[20];};class GrandSon : public GrandChild{public:GrandSon{char *name} {}Char * getAddress() const { return "Shanghai";}};int main(){GrandChild *gs=new GrandSon("Feifei");coutgs-getName()" 住在 "gs-getAddress()endl;delete gs;return 0;}运行时的输出结果是 【 13 】 。
以下语句输出结果是( )。 Private Sub Form_Click() A="Beijing" b="ShangHai" Print a;b End Sub A. Beijing ShangHaiB. AbeijingShangHaiC. BeijingShangHaiD. Abeijing
有如下程序:#includeiostreamusing namespace std;class A{public:A(int i):r1(i){}void print(){cout‘E’rl‘-’;}void print()const{cout‘C’rl*rl‘-’;}private:int rl:};int main(){A a1(2); const A a2(4);a1.print(); a2.print();return 0;}运行时的输出结果是A.运行时出错B.E2-C16-C.C4-C16-D.E2-E4-
有如下程序:includeusing namespace std;class MyClass{public: MyClass(int x):val( 有如下程序: #include<iostream> using namespace std; class MyClass{ public: MyClass(int x):val(x) {} void Print() const {cout<<"const:val="<<val<<'\t';} void Print() {cout<<"val="<<val<<'t';} private: int val; }; int main() const MyClass obj1(10); MyClass obi2(20); obj1.Print(); obj2.Print(); return 0; } 程序的输出结果是( )。A.val=10 const:val=20B.const:val=10 const:val=20C.const:val=10 val=20D.val=10 val=20
有如下程序段: const c$="Beiijing" c$="Shanghai" c$="Hebei" Print c$ 运行时输出的结果是( )。A.BeijingB.ShanghaiC.HebeiD.显示出错信息
有如下程序:includeusing namespaee std;class A{public:A(int i):rl(i){ }void prin 有如下程序: #include<iostream> using namespaee std; class A{ public: A(int i):rl(i){ } void print( ){cout<<'E'<<rl<<'-';} void print( )const}cout<<'C'<<rl*rl<<'-';} private: int rl; }; int main( ){ A al(2);eonst A a2(4); a1.print( );a2.print( ); return 0; } 程序的输出结果是A.运行时出错B.E2-C16-C.C4-C16-D.E2-E4-
有如下程序: #inCludeiostream using namespaCe std; Class MyClass{ publiC: MyClass(int X):val(X){} void PrintConst}tout”Const:val=”val’\t’;} void Print{tout”val=”val’\t’;} private: int val; }; int main{ Const MyClass objl(10); MyClass obj2(20); objl.Print; obj2.Print; retum 0; } 执行这个程序的输出结果是( )。A.val=10 Const:val=20B.Const:val=10 Const:val=20C.Const:val=10 val=20D.val=10 val=20
有如下程序段: Const c$="Beijing'’ C$=”Shanghai” C$="He bel" Print C$ 运行时输出的结果是( )。A.BeijingB.ShallSh9iC.HebeiD.显示出错信息