[单选题]

下面程序运行时输出结果为______。 include include class Rect { public: Rect(int

下面程序运行时输出结果为______。

include<iostream.h>

include

class Rect

{

public:

Rect(int l, int w){length=l; width=w;)

void Print(){cout<<"Area:"<<length*width<<end1;}

void operator delete(void*p){free(p);}

private:

int length, width;

};

void main()

{

Rect *p;

p=new Rect(5, 4);

p->Print();

delete p;

}

参考答案与解析:

相关试题

下面的程序运行后输出为()。#include #include main(){

[单选题]下面的程序运行后输出为()。include include main(){int a,b;float c;b = 5;下面的程序运行后输出为( )。 #include <stdio.h> # include <math.h> main() { int a,b; float c; b = 5;c = 6;c = b+7;b = c+1; a = sqrt((double)b+c); printf("%d,%f,%d",a+6,C,b); }A.11.000000,12.0000000,13.

  • 查看答案
  • 下列程序运行后,输出结果是______。 #include #include

    [单选题]下列程序运行后,输出结果是______。 include include fun(char *w ,int下列程序运行后,输出结果是______。 #include <stdio. h> #include <string. h> fun (char *w ,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while (s1<s2) { t=*s1++; *s1=*s2--; *s2=t; } } main () { char *p; p="1234567

  • 查看答案
  • 下列程序的执行结果是______。 #include #include clas

    [单选题]下列程序的执行结果是______。 include include class TestClass { publ下列程序的执行结果是______。 #include<iostream.h> #include<stdlib.h> class TestClass { public: int x,y; TestClass () {x=y=0;} TestClass (int a,int b){x=a;y=b;} void disp() { cout<<"x="<<x<<",y="<<y<<en

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

    [单选题]下面程序的输出结果是#include#includevoid main(){char p1[10],p2[10];strepy(p1,”abc”):strcpy(p2,”ABC”);char str[50]=”xyz”;strcpy(str+2,strcat(p1,p2));cout <}A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

  • 查看答案
  • 下面程序的输出结果是 ( ) # include # include { cha

    [单选题]下面程序的输出结果是 ( ) include include { char * p1="abc" , *下面程序的输出结果是 ( ) # include<stdio.h> # include<string.h> { char * p1="abc" , * p2=" ABC ",str[50]="xyz"; strcpy(str+2.strcat (pi,p2)); printf("%s/n",str);}A.xyzabcABB.zabcABCC.yzabcABCD.xyc

  • 查看答案
  • 下面程序的运行结果是 ( ) # include # include main(

    [单选题]下面程序的运行结果是 ( ) include include main( ) { char * a="下面程序的运行结果是 ( ) # include<stdio.h> # include<string.h> main( ) { char * a="AbcdEf",* b="aBcD" a + +;b + +; printf("%d/n",strcmp(a,b)); }A.0B.负数C.正数D.无确定值

  • 查看答案
  • 下面程序的输出结果为______。 #include main() { char

    [单选题]下面程序的输出结果为______。 include main() { char p1[7]="abc",p2[]="ABC",str[50下面程序的输出结果为______。 #include<string.h> main() { char p1[7]="abc",p2[]="ABC",str[50]="xyz"; strcpy(str,strcat(p1,p2)); printf("%s",str); }A.xyzabcABCB.abcABCC.xyzabcD.xyzAB

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

    [主观题]下面程序运行后输出的结果是()。 include using namespace std; class example{ const下面程序运行后输出的结果是[ ]。include <iostream>using namespace std;class example{const int m;public:example(int i):m(i){}void pr(){cout<<"m="<<m<<endl'}};int main(){example x(100);x.pr();retur

  • 查看答案
  • 下面程序的运行结果为 #include classA { staticintn;

    [单选题]下面程序的运行结果为#includeclass A{static int n;public:A.(){n=1;}A.(int num){n=num;}void print(){coot <}int A::n=2:void main(){A. a.b(3);a.print();b.pint();cout <}A.11B.13C.23D.33

  • 查看答案
  • 下面程序的运行结果为( )。 #include using namespace

    [单选题]下面程序的运行结果为( )。 include using namespace std; class A{ pu下面程序的运行结果为( )。 #include <iostream> using namespace std; class A{ public: A(){cout<<" ";} ~A(){cout<<" ";} } class B:public A{ public: B(){cout<<" ";} ~B(){cout<<" ";} } void main(){ B b;

  • 查看答案
  • 下面程序运行时输出结果为______。 include include clas