单选题有如下程序: #inc1ude<iostream> using namespace std; c1ass Pair{ int m,n; public: Pair(int j,intk):m(j),n(k){} int get(){return m;} int get()const {return m+n,} }; int main(){ Pair a(3,5); const Pair b(3,5); cout<<a.get()<<b.get(); return 0; } 运行时的输出结果是( )。
单选题下列叙述中正确的是( )。
单选题有如下类定义:
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<<a;}//④
};
其中四个函数的定义中正确的是______。
单选题关于二义性的描述错误的是( )。
单选题数据结构主要研究的是数据的逻辑结构、数据的运算和( )。
单选题下面的函数调用为: fun(x+y,3,min(n-1,y))则fun的实参个数是( )。
单选题有下列程序: #include<stdio.h> void main() int x=8; for(;x>0;x--) if(x%3)printf("%d,",x--);continue; printf("%d,",--x); 程序的运行结果是( )。
单选题在数据结构中,从逻辑上可以把数据结构分成
____
。
单选题有如下程序: #include<iostream> using namespace std; class TestClass public: TestClass () cout<<"BB";fun(); void fun() cout<<"Bf"; ; class TestClass1 :public TestClass public: TestClass 1() cout<<"DD"; void fun() cout<<"Df'; ; int main() TestClass 1 d;return 0; 执行上面的程序将输出( )。 A) BBBfDD B) BBDfDDDf C) DD D) DDBBBf
单选题下列符号中,正确的C++标识符是( )。
单选题有如下语句序列: int x=100,
cout<<x<<'-'<<r<<end1:
己知其中变量x的地址为0012FF7C,则执行该语句序列的输出结果为{{U}} {{/U}}。
A. 100-100
B. 100-0012FF7C
C. 0012FF7C-100
D. 0012FF7C-0012FF7C
单选题若磁盘上已存全路径文件名为c:/ctest/test.txt的文件,下面语句中不能打开该文件的是( )。
单选题具有3个结点的二叉树有
单选题下列关于线性链表的叙述中,正确的是( )。
单选题下面关于类概念的描述中
____
是错误的。
单选题执行下列语句: #include<iostream> using namespace std; int main() { int x=3; if(x=5) cout<<x++<<endl; else cout<<x<<endl; return 0; } 程序的输出是( )。
单选题若有以下程序:
main( )
{ int k=2,i=2,m;
m=(k+=i*=k);
cout<<m<<","<<i<<endl;
}
执行后的输出结果是
单选题在微机中,西文字符所采用的编码是( )。
单选题设有以下类和对象的定义:
class A
{ public;
int m;
};
A k1,k2, *p1,*p2;
则下面针对成员变量m的引用,错误的是______。
单选题有以下程序 #include <iostream>
using namespace std;
class Complex {
public: Complex (double r=0,
double i =0 :re(r) ,im (i) {}
double real() const {return re;}
double imag() const { return
im;} Complex operator
+ (Complex c} const
{return Complex(re+c.re, im+c.im);}
privane: double re,im;
}; int main
{ Complex a
=Complex(1,1)+Complex(5);
cout<<a.real()<<'+'<<a.imag() << 'i' <<endl
return 0; }
程序执行后的输出结果是
A. 6+6i
B. 6+1i
C. 1+6i
D. 1+1i
