单选题以下程序的输出结果是( )。
#include<iostream.h>
void main( )
{ inti,j,x=0;
for(i=0;i < 2;i++)
{ x++;
for(j=0;j < 3;j++)
{ if (j% 2)continue;
x++;}
x++;}
cout < < "x=" < < x;}
单选题下列特征中不是面向对象方法的主要特征的是 ( )。
单选题类的析构函数的作用是( )。
单选题有如下程序:
#include
using namespace std;
void _________ {int z=x; x=y; y=z;}
int main() {
int x=0,y=1;
f(x,y);
cout<
单选题数据的存储结构是指( )。
单选题如下类定义:class AA {int a;public:int getRef()const { return } //①int getValue()const { return a; } //②void set(int n)const { a=n; } //③friend void show(AA aa)const { cout<
单选题有如下程序: #include<iostream> using namespace std; class Book{ public: Book(char*t='' ''){strcpy(title,t);} private: char title[40];}; class Novel:public Book{ public: Novel(char*t=''''):Book(t){} char*Category()const{return''文学'';} }; int main(){ Book* pb; pb=new Novel(); cout<<pb->Category(); return 0: } 若程序运行时输出结果是“文学”,则划线处缺失的语句是( )。
单选题有如下4个语句:
①count<<''A''<<setfill(''x'')<<left<<setw(7)<<''B''<<endl;
②count<<setfill(''x'')<<left<<setw(7)<<''A''<<''B''<<endl;
③count<<''A''<<setfill(''*'')<<right<<setw(7)<<''B''<<endl;
④count<<setfill(''x'')<<right<<setw(7)<<''A''<<''B''<<endl;
其中能显示A * * * * * * B的是
单选题设表的长度为20。则在最坏情况下,冒泡排序的比较次数为( )。
单选题类MyClass的定义如下: class MyClass { public: MyClass(){value=0;} SetVariable(int i){value=i;} private: int value; };则对下列语句序列正确的描述是( )。 MyClass*P,my;P=&my;
单选题有如下程序:
#include<iostream>
using namespace std;
class Sample {
friend long fun(Sample s);
public:
Sample(long a) {x=a;}
private:
long x;
};
long fun(Sample s) {
if(s. x<2)return 1;
return s. x*fun(Sample(s. x-1));
}
int main()
{
int sum=0;
for(int i=0; i<6; i++)
{sum +=fun(Sample(i));}
cout<<sum;
return 0;
}
执行这个程序的输出结果是______。
单选题执行下列语句段后,输出字符“*”的个数是( )。 for(int i=50;i>1:——i)cout<<'*';
单选题执行下列程序的结果是( )。 #include<iostream.h> void main() char *str; str="test!"; cout<<str[5];
单选题有如下程序: #include<iostream> using namespace std; class Test { public: Test(){n+=2;} ~Test(){n-=3;} static int getNum(){return n;} private: static int n; }; int Tesl::n=1 int main() { Test*p=new Test; delete p; cout<<"n="<<Tes::tgetNum()<<endl; return 0; } 执行后的输出结果是
单选题有以下程序
main( )
{ int i=0,s=0;
do{
if (i%2){i++;continue;}
i++;
s+=i;
}while(i<7);
cout<<s<<endl;
}
执行后输出结果是
单选题若有int a[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};int(*q)[3]=a,*p a[0];则能够正确表示数组元素 a[1][2]的表达式是 ______。
单选题下列关于继承的描述中,错误的是( )。
单选题以下程序执行后的输出结果是 #include<iostream>
using namcspace std; void try(int,int,int,int);
int main() { int
x,y,z,r; x=1;
y=2; try(x,y,z,r);
cout<<r<<end1; return 0;
} void try(int x,int y, int z,int r)
{ z = x+y;
x = x*x; y = y*y;
r = z+x+y; }
A. 18
B. 9
C. 10
D. 不确定
单选题数据库设计的根本目标是要解决( )。
单选题下列实现C语言语句printf("Hello!")的相同功能的语句是( )。