选择题 若有定义“int x=4,y=5;”,则表达式“y>x++?x--:y++”的值为______。
选择题 若有定义“int k,*q;”,则下列各选项中,赋值表达式正确的是 。
选择题 软件生命周期是指 。
选择题 下面有关重载函数的说法中,正确的是 。
选择题 下列程序中横线处应填入的语句是 。
Class Base
{
public:
roid fun(){cout<<'Base of fun'<<endl;)
};
class Derived:public Base
{
void fun()
{
//显示基类的成员函数fun
cout<<'Derived Of fun'<<endl;
}
};
选择题 有如下程序:
#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;
}
执行这个程序的输出结果是______。
选择题 有如下语句序列:
ifstream infile('DATA.DAT');
if(infile.good())cout<<'A';
else{
cout<<'B';
ofstream outfile('DATA.DAT');
if(outfile.fail())cout<<'C';else cout<<'D';
}
若执行这个语句序列显示的是BD,则说明文件DATA.DAT______。
选择题 在E-R图中,表示实体的图元是______。
选择题 C++语言中标点符号中表示一条预处理命令开始的是______
选择题 面向对象方法中,继承是指______。
选择题 下列有关运算符函数的描述中,错误的是______。
选择题 若变量已正确定义,有下列程序段
int a=3,b=5,c-7;
if(a>b)a=b;c-a;
if(c!=a)c=b;
printf('%d,%d,%d\n',a,b,c);
其输出的结果是______。
选择题 有下列程序:
#include <stdio.h>
#include'string.h'
tyoedef struct{char name[9];char sex;float score[2];}STU;
void f(STU a)
{
STU b={'Zhao','m',85.0,90.0};int i;strcpy(a.name,b.name);
a.sex=b.sex;
for(i=0;i<2;i++)a.score[i]=b.score[i];
}
void main()
{
STU c=('Qian','f',g5.0,92.0);
f(c);
printf('%s,%c,%2.of,%2.of\n',c.name,c.sex,
c.score[0],c.score[1]);
}
程序的运行结果是______。
选择题 有如下类定义:
class MyClass{
int value;
public:
MyClass(int n):value (n){}
int getValue()const{return value;}
};
则类MyClass的构造函数的个数是______。
选择题 有以下结构体说明和变量的定义,且指针p指向变量a,指针q指向变量b。则不能把节点b连接到节点a之后的语句是______
struct node
{ char data;
stmct node * next;
} a,b, * p=a, * q=b;
选择题 下面不属于软件设计原则的是 。
选择题 下列有关数据库的描述,正确的是______。
选择题 有如下程序段:
int i=1;
while(1){
i++;
if(i==10)break;
if(i%2==0)cout<<'*';
}
执行这个程序段输出字符'*'的个数是______。
选择题 串的长度是 。
选择题 以下程序的输出结果是______。
#inclucle<iostrcam.h>
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return S;
}
void main(){ cout<<fun (3);}
