填空题语句cout<<setiosflagags(ios::showpos)<<125<<"/t"<<-125<<endl;的输出结果为
________
。
填空题使用VC6打开考生文件夹下的工程test4_1,此工程包含一个源程序文件test4_1.cpp,但该程序在类的定义中存在问题,请改正类定义中的错误,使程序的输出结果如下: a=3 b=13 a=5 b=13 注意:请勿修改主函数main中的任何内容。 源程序文件rcst4_1.cpp清单如下: #include<iostream.h> class T public: /*********found***+******/ T(int x)a=x; b+=x;) /+********found**********/ void display(T c) cout<<"a="<<c.a<<"/t"<<"b="<<c.b<<endl;) private: const int a; static int b; ; /**********found*********/ int b=5; void main() T A(3),B(5); T::display(A); T::display(B);
填空题在数据库的概念结构设计中,常用的描述工具是______。
填空题有以下程序#include <iostream>using namespace std;class Base int a;public: Base(int x) a=x; void show() cout<<a; class Derived: public Base int b;public: Defived(int i):Base(i+ 1 ),b(i) void show() cout<<b; ;int main() Base b(5),*pb; Derived d(1); pb= pb->show(); return 0;运行后的打印结果是 【13】 。
填空题下面程序的输出是: ***********5.23 5.23*********** 请将下划线上遗漏的部分补充完整。 #include<iostream> #include<iomanip> using namespace std; void main() double i=5.23; cout<< 【14】 <<setw(14)<<i cout<<endl<< 【15】 <<setw(14)<<i;
填空题表达式c3=c1.operator+(c2)或c3=operator+(cl,c2)还可以表示为______。
填空题以下程序的输出结果是{{U}} 【8】 {{/U}}。
#include<iostream.h>
voidfun( )
{ staticinta=0;
a+=2;
cout<<a<<"";}
voidmain( )
{ intcc;
for(cc=1;cc<4;cc++)
fun( );
cout<<endl;}
填空题阅读下面程序:
#include <iostream.h>
int fun(int a,int b)
{
int t;
c=a*b:
return c;
}
void main()
{
int a=3,b=5,c=4,x=0;
x=fun(fun(a,b),c);
cout<<x<<endl;
}
其运行结果是______。
填空题设一棵完全二叉树共有839个结点,则在该二叉树中有______个叶子结点。
填空题下列程序的运行结果是 【15】 。 #include<iostream, h> class Sample int a; public: Sample(int aa=0) a=aa; ~Sample() cout<<"Sample="<<a<<; class Derived: public Sample int b; public: Derived(int aa=0, int bb=0): Sample(aa) b=bb; ~De rived() cout <<"Derived="<<b<<''; void main() Derived dl (9)
填空题一个项目具有一个项目主管,一个项目主管可管理多个项目。则实体集“项目主管”与实体集“项目”的联系属于{{U}} 【4】 {{/U}}的联系。
填空题数据结构分为逻辑结构和存储结构,树形结构属于 【4】 结构。
填空题语句序列long x;x=0L;可用一个语句表示为______。
填空题开发一个C++语言程序的步骤通常包括编辑、{{U}} {{/U}}、链接、运行和调试。
填空题若要访问指针变量P所指向的数据,应使用表达式______。
填空题有如下程序: #include<iostream> using namespace std; class Base int b; public: Base(int i)b=i; void disp( )cout<<"Base:b="<<b<<''; ; class Basel:virtual public Base public: Basel(int i):Base(i) f; class Base2:virtual public Base public: Base2(int i):Base(i) ; class Derived:public Base2.public Basel int d; public: Derived(inl i,int j):Basel(j),Base2(J),______d=i; void disp( )cout<<"Derived:d="<<d<<": f; int main( ) Derived objD(1,2);objD.disp( ); objD.Basce::disp( ); objD.Bascel::disp( ); objD.Basce2::disp( ); return 0; 请将程序补充完整,使程序在运行时输出: Derived:d=1 Base:b:2 Base:b=2 Base:b=2
填空题除析构函数外,不能带有参数的函数还有 [10] 。而且它的返回数据类型不能随便指定,而由 return语句中返回变量的类型决定。
填空题下列程序的输出结果是【 】。
#include<iostream>
using namespace std;
class base{
public:
int n;
base (int x){n=x;}
virtual void set (int m){n=m;cout<<n<<;}
};
class deriveA:public base{
public:
dericeA(int x):base(x){}
void set(int m){n+m;cout<<n<<'''';}
};
Class deriveB:public base{
public:
deriveB(int x):base(x){}
void set(int m){n+m;cout<<n<<'''';}
};
int main()
{
deriveA d1(1);
deriveB.d2(3);
base*pbase;
pbase=&d1;
pbase->set(1);
pbase=&d2;
pbase->set(2);
return 0;
}
填空题在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。 #include<iostream> using namespace std; classA public: A()cout<<'A'; ; class B:______ public: B()cout<<'B'; ; class C:______ public:C()cout<<'C'; ; class D:public B,public C public:D()cout<<'D'; ; void main()D obj;)
填空题请在横线处填写派生类Derived的继承方式,使得程序的输出结果为Base。 #include <iostream> using namespace std; class Base public: void print() cout<<"Base"; ; class Derived:______Base; int main() Derived d; d.print(); return 0;
