[单选题]

下面程序的输出结果是()。include using namespace std;class A {public:A( ) {cout<<

下面程序的输出结果是( )。 #include <iostream> using namespace std; class A { public: A( ) {cout<<"A";} } class B { public: B() {coat<<"B" ;} } class C: public A { public: B b; C() {cout<<"C";} } void mian(){ C c; }

A.CBA

B.ABC

C.ACB

D.BCA

参考答案与解析:

相关试题

下面程序的输出结果是()。#include using namespace st

[单选题]下面程序的输出结果是()。include using namespace std;void main( )int i,j,m=0,n=0;下面程序的输出结果是( )。 #include <iostream> using namespace std; void main( ) int i,j,m=0,n=0; for(i=0;i<2;i++) for(j=0;j<2;j++) if(j> =i) m=1;n++; cout<<m<<endl; cout<<n;A.1 1B.1 4C.1 6D.0

  • 查看答案
  • 下面程序的输出结果是()。#include using namespace st

    [单选题]下面程序的输出结果是()。include using namespace std;void main( ){int i=8,*p=0; p下面程序的输出结果是( )。 #include <iostream> using namespace std; void main( ) { int i=8,*p=0; p = &i; coat<<p; }A.0B.变量i的地址C.*p=0; 是错误的,因为不可给指针型变量赋予常数值D.8

  • 查看答案
  • 下面程序的输出结果是()。#include using namespace st

    [单选题]下面程序的输出结果是()。include using namespace std;int fun (int, int);£¯£¯fun ( )下面程序的输出结果是( )。 #include <iostream> using namespace std; int fun (int, int); //fun ( ) 函数的说明 void main( ) { int a =48,b =36,c; c = fun(a,B) ; cout<<c; } int fun(int u,int v) { int

  • 查看答案
  • 以下程序的输出结果是()。 include using namespace st

    [主观题]以下程序的输出结果是()。 include using namespace std; int main() {char S[]="abcde以下程序的输出结果是[ ]。include <iostream>using namespace std;int main(){char S[ ]="abcdef";s[3]='\0';cout<<s<<end1;return 0;}

  • 查看答案
  • 下面程序输出的结果是( )。 #include using namespace

    [单选题]下面程序输出的结果是( )。 include using namespace std; void swap(int下面程序输出的结果是( )。 #include <iostream> using namespace std; void swap(int &a,int &b){ int temp; temp=a; a=b; b=temp; } void main(){ int x=2; int y=3; swap(x,y); cout<<x<<y; }A.23B.32C.abD.

  • 查看答案
  • 下面程序的输出结果是( )。#include using namespace s

    [单选题]下面程序的输出结果是( )。include using namespace std;void main(){int s;for(int k下面程序的输出结果是( )。#include <iostream>using namespace std;void main(){int s;for(int k=2;k<6;k+=2)s=1;for(int j=k; j<6;j++) s+=j;cout<<s<<end1;A.9B.1C.11D.10

  • 查看答案
  • 以下程序执行后的输出结果是#include using namespace st

    [单选题]以下程序执行后的输出结果是include using namespace std;void try(int,int,int,int)以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y

  • 查看答案
  • 执行下面程序后输出的结果是()。#include using namespace

    [单选题]执行下面程序后输出的结果是()。include using namespace std;int main(){ int a[4][4执行下面程序后输出的结果是( )。 #include <iostream> using namespace std; int main(){ int a[4][4]={{1,2,3,-4},{7,-12,-13,8},{-21,9,0,-24},{-31,10,-33,11}}; int i,j,s=0; for(i=0;i<4;i++){ for(j=0;j<4;

  • 查看答案
  • 下列程序的输出结果是( )。 #include using namespace

    [单选题]下列程序的输出结果是( )。 include using namespace std; int main() {下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char *p=a; while(*p) { if(*p>='a'&&*p<='z') cout<<char(*p+'A'-'a'); else cout<<*p; p+

  • 查看答案
  • 下列程序的输出结果是( )。 #include using namespace

    [单选题]下列程序的输出结果是( )。 include using namespace std; class TestClass下列程序的输出结果是( )。 #include<iostream> using namespace std; class TestClass{ static int i; public: TestClass(){i++;} ~TestClass(){i--;} static int getVal(){return i;} }; int TestClass::i=O; void f

  • 查看答案
  • 下面程序的输出结果是()。#include using namespace st