填空题我们通常用到的cin > > ,是属于 【15】 输入。
填空题以下程序运行后的输出结果是 【11】 。 #include<iostream.h> void main() char a[]="abcdabcabfgacd"; int i 1=0,i2=0,i=0; while (a[i]) if (a[i]=='a') il++; if (a[i]=='b') i2++; i++; cout<<il<<' '<<i2<<endl;
填空题在岂个容量为25的循环队列中,若头指针front=9,尾指针Year=16,则该循环队列中共有______个元素。
填空题下列for语句的循环次数为{{U}}【8】{{/U}}。
for(int a=0,b=1;b&&a<5;a++);
填空题有如下程序: #include <iostream> using namespace std; class shapes protected: int x,y; public: void setvalue(int d, int w=0) x=d; y=w; virtual void disp()=0; ; class square : public shapes public: void disp() cout<<x*y<<end1; ; int main() shapes *ptr; square s1; ptr= ptr->setvalue(10,5); ptr->disp(); return 0; 执行上面的程序将输出 【14】 。
填空题在C++中,编译时的多态性是通过模板或函数【12】实现的。
填空题下列类的构造函数不能通过编译,正确的构造函数应该是 【15】 。# inelude<iostream. h>class Samplepublic: int ns const int con, Sample(int m) con= m+1; n= m; void disp() cout<<'"normal: n="<<n<<end1; void disp()const cout<<"static: n="<<n<< end1; ;void main() const Sample a(12), Sample b(13), a. disp( ), b. disp() cout<<a, n<< "<<b. con<<end1;
填空题若要在C盘根目录下作为二进制文件打开文件test.dat ,则应该用的语句是{{U}} 【15】 {{/U}}。
填空题下列程序是一个函数模板,用于把数组a的每个元素按照逆序放入数组b中。请填空完成该函数模板的定义 template<class Type> void Func(Type a[], Type b[], 【10】 ) for(int i=0;i<n;i++) b[n-i-1]=a[i];
填空题结构化程序设计方法的主要原理的是{{U}} [2] {{/U}}。
填空题在类中,{{U}} 【10】 {{/U}}成员为类的所有对象所共享。
填空题请将下面的程序补充完整,使得程序输出“飘是张娜的书”。 #include<iostream> using namespace std claSS Book public: Book(char*str)| strcpy(title,str); void Printlnfo()cout<<title<<end1; protected: char title[50]; ; class MyBook:public Book public: MyBook(char*s1,char*s2="张娜"); ______(strcpy(owner,s2); virtual void Printlnfo()cout<<title<<"是"<<owner<<"的书"<<end1; private: char owner[10]; ; int main() Book *ptr=new MyBook("飘"); ptr—>PrintInfo(); return 0;
填空题已知递归函数fun的定义如下: int fun(int n) if(n<=1) return 1;//递归结束情况 else return n *fun(n-2);//递归 则函数调用语句fun(5) 的返回值是______。
填空题软件工程的框架可概括为:目标、过程和 【4】 。
填空题在双目运算符中需要声明其右操作数时,完成的是 【8】 重载,而需要声明全部操作数时,完成的是 【9】 重载。
填空题带有______的类称为抽象类,它只能作为______来使用。
填空题在一个C++程序中,每个变量都必须遵循 【6】 的原则。
填空题函数调用时,若形象,实参均为数组,则其传递方式是 [10] 。
填空题通过使用new和delete两个运算符进行的分配为{{U}} 【9】 {{/U}}存储分配。
填空题在类的对象被创建时,______函数会被自动调用。
