单选题下面描述中,符合结构化程序设计风格的是( )。 A.使用顺序、选择和重复(循环)三种基本控制结构表示程序的控制逻辑 B.模块只有一个入口,可以有多个出口 C.注重提高程序的执行效率 D.禁止使用goto语句
单选题在面向对象方法中,不属于“对象”基本特点的是( )。
单选题面向对象程序设计将数据和( )放在一起,作为一个相互依存、不可分割的整体来处理。
单选题有如下程序: #include<iostream> using namespace std; class Base { private: void fun1() const{cout<<''fun1'';} protected: void fun2() const{cout<<''fun2'';} public: void fun3() const{cout<<''fun3'';} }; class Derived:protected Base { public: void fun4()const{cout<<''fun4";} }; int main() { Derived obj; obj.funl(); //① obj.fura(); //② obj.fun3(); //③ obj.fun4(); //④ return 0; } 其中有语法错误的语句是( )。
单选题有如下程序:
#include
using namespace std;
void fun(int&x,int y){imt t=x;x=y;y=t;}
int main()
{
int a[2]={1,2};
fun(a[1],a[0]);
std∷cout<
单选题已知表达式++x中的“++”是作为成员函数重载的运算符,则与++x等效的运算符函数调用形式为( )。
单选题有如下类定义:
class MyClass{
Int value;
public;
MyClass(int n):value(n){}
int gerValue()const{return value;}
};
则类MyClass的构造函数的个数是______。
单选题有如下程序:
#include
#include
using namespace std;_
int main(){
Cout<
单选题程序调试的任务是
单选题以下程序的输出结果是{{U}} {{/U}}。
#include<iostream.h> void main() {int i,
j,x=0; fof (i=0;i<2;i++= {x++;
for(j=0;j<3;j++= {if(j%2)continue:
x++; x++;} cout<<"x="<<x;=
A. x=4
B. x=8
C. x=6
D. x=12
单选题下列关于C++函数的叙述中,正确的是( )。
单选题若有以下程序:
#include<iostream>
usingnamespacestd;
voidsub(intx,inty,int*2)
{
*z=y+x;
}
int main()
{
int a,b,C;
sub(8,4,&A) ;
sub(6,a,&B) ;
sub(a,b,&C) ;
cout<<a<<","<<b<<","<<c<<end1;
return 0;
}
程序运行后的输出结果是
单选题对于模板定义关键字class和typename说法不正确的是
____
。
单选题有如下程序:#include <iostream>#include <iomanip>using namespace std;int main()cout.fill('*');cout<<left<<setw(4)<<123<< "OK"<<end1;return 0;执行这个程序的输出结果是( )。
单选题有如下程序:
#include
using namespace std;
class TestClass
{
public:
TestClass(){cout<<“default constructofln”;}
TestClass(const TestClass&x){cont<<”copy
constructorXn”;)
};
TestClass userCode(TestClass b){TestClass
c(b);return c;}
int main()
{TestClass a,d;
cout<<“calling userCodeoha”;
d=userCode(a);
return 0:
}
执行上面程序的过程中,构造函数TestClass 0和TestClass(const TestClass&x)被调用的次数分别是( )。
单选题在一棵二叉树上,第5层的结点数最多是( )。
单选题结构化程序设计的基本原则不包括( )。
单选题在软件开发中,需求分析阶段产生的主要文档是( )。
单选题有如下程序 #include<iostream.h> void main() char ch[2][5]=="6937","8254",*p[2]; int i,j,s=0; for(i=0;i(2;i++)p[i]=ch[i]; for(i=0;i(2;i++) for(j=0;p[i][j]>'/0,j+=2) s=10*s+p[i][j]-'0'; cout<<s; 该程序的输出结果是( )。
单选题如果表达式--x/y中的“--”和“/”是作为友元函数重载的运算符,采用运算符函数调用格式,该表达式还可表示为 A) operator/(x.operator--(),y); B) operator/(operator--(x),y); C) x.operator--().operator/(y); D) y. operator/(operator--(x));