填空题若从键盘输入70,则以下程序输出的结果是______。 #include <iostream.h> void main() int a; cin>>a; if(a>50) cout<<a; if(a>40) cout<<a; if(a>30) cout<<a;
填空题作为成员函数重载的运算符,第一操作数就是参数表中隐含的________所指向的对象,因此并不显示地出现在参数表中。
填空题表达式x=operator-(y,z)可以表示为______。
填空题数据流图的类型有 【4】 和事务型。
填空题插入排序算法的主要思想:每次从未排序序列中取出一个数据,插入到己排序序列中的正确位置。Insert类的成员函数sort()实现了插入排序算法,请填空。
class Insert{
public:
Insert(int *b0,int n0):b(b0),n(n0){};//参数b0是某数组首地址,n是数组元素个数
void sort()
{//此函数假设已排序序列初始化状态只包含b[0],未排序序列初始为b[1]...b[n-1]
for(int i=1;i<n;++i)
{
int t=b[i];
int j;
for(______;j>0;--j)
{
if(t>=b[j-1])
break;
b[j]=b[j-1];
b[j]=t;
}
}
}
填空题阅读下面程序:
#include<iostream.h>
void f(int n)
{
int x(5);
static int y(10);
if(n>0)
{
++x;
++y;
cout<<x<<","<<y<<endl;
}
}
void main()
{
int m(1);
f(m),
}
则该程序的输出结果是{{U}} 【14】 {{/U}}。
填空题阅读下面程序: #include<iostream> using namespace std; long fib(int n) if ( n > 2 ) return (fib(n-1)+fib(n-2)); else return 2; int main() cout<<fib(3)<<end1; return 0; 则该程序的输出结果应该是 【8】 。
填空题软件测试分为白箱(盒)测试和黑箱(盒)测试,等价类划分法属于______测试。
填空题cin.getline(line,sizeof(line),'x')表示的意思是读取90个字符存放到line如果遇到_____则结束输入。
填空题根据下面的主程序,完成类的一种构造函数的最简单形式。
#include<iostream. h>
class base
{
private:
int num;
public:
{{U}} 【10】 {{/U}};
};
void main()
{
base try(6);
}
填空题有如下程序: #include <iostream> using namespace std; class PARENT public: PARENT( )cout<<"PARENT"; ; class SON:public PARENT public: SON( )cout<<"SON"; ; int main( ) SON son; PARENT*P; P=son; return 0; 程序的输出结果是______。
填空题以下程序的输出结果为 【7】 。 #include<iostream> using namespace std; void initialize(int printNo,int state=0); void initialize(int printNo=l,int state); int main() initialize(); return 0; void initialize(int printNo,int state) cout<<printNo<<","<<state<<end1;
填空题以下程序运行后的输出结果是{{U}} 【10】 {{/U}}。
#include<iostream.h>
void fun(int x,int y)
{ x=x+y;y=x-y;x=x-y;
cout<< x << "," <<y << " ,";}
void main( )
{ int x=2,y=3;fun(x,y);
cout<< x << "," << y << endl;}
填空题如果表达式--x中的“--”是重载的类运算符,采用运算符函数调用格式,及表达式还可以表示为 【7】 。
填空题头文件______中包含了处理用户控制的文件操作所需的信息。
填空题下列程序的输出结果是______。 #include<iostream.h) template<class T> Tmax(T x[],int n) int i; T maxv=x[0]; for(i=1;i(n;i++) if(maxv maxv=x[i]; return maxv; void main() inta[]=3,2,7,6,8,9; double b[]=1.2,3.4,2.5,7.3,6.8; cout<<max(a,4)<<","<<max(b,3)<<endl;
填空题以下程序的输出结果是 【14】 。 #include<iostream.h> void main( ) int a=0; a+ =(a=8); cout < < a;
填空题开发一个C++语言程序的步骤通常包括编辑、{{U}} 【6】 {{/U}}、链接、运行和调试。
填空题下面程序的输出结果是{{U}} 【8】 {{/U}}。
#include <iostream>
using namespace std;
int x;
void funA(int
void funB(int,int
int main ( )
{
int first;
int second=5;
x=6;
funA(first,second) ;
funB(first,second) ;
cout<<first<<" "<<second<<" "<<x<<end1;
return 0;
}
void funA(int
first=a+b;
a=2*b;
b=first+4;
}
void funB(int u, int
second=x;
v=second+4;
x=u+v;
}
填空题创建对象数组时,对数组的每一个元素都将调用一次构造函数,如果没有显式给出数组元素的初值,则调用默认构造函数,下列程序涉及对象数组的创建和单个对象的创建,其输出结果是______。
#include <iostream>
using namespace std;
class Foo{
public:
Foo(int x){eout<<"A";}
Foo( ){}
};
int main( ){
Foo f[3],g(3);
return 0;