语句cout<<(1&2)<<","<<(1&&2)<< endl;的输出结果是()
第1题:
与语句cout<
A.cout<<‘\n';
B.Cout<<’\12';
C.cout<<’\xA';
D.cout<<’\0';
第2题:
执行下列语句段后程序的输出结果是______。
int x[]={1,2,3,4,5};
int q=x;
cout<<*(++q)<<end1;
第3题:
执行以下程序,输出结果的最后一行语句是______。
include <iostream.h>
class Sample
{
int x,y;
public:
Sample(){x=y=0;}
Sample(int a,int b){x=a;y=b;}
~Sample()
{
if(x==y)
cout<<"x!=y"<<end1;
else
cout<<"x!=y"<<end1;
}
void disp()
{
cout<<"x="<<x<<",y="<<y<<end1;
}
};
void main()
{
Sample s1(2,3);
s1.disp();
}
第4题:
对于语句cout<<end1<<x;中的各个组成部分,下列叙述中错误的是______ 。
A.“cout”是一个输出流对象
B.“end1”的作用是输出回车换行
C.“x”是一个变量
D.“<<”称作提取运算符
第5题:
执行“cout.<<char(‘F’,-2)<<end 1;”语句后得到的输出结果为【 】。
第6题:
与语句cout< <endl; 不等价的是
A.cout < <'\n';
B.cout < <'\12';
C.cout < <'\xA';
D.cout < <'\0';
第7题:
语句cout<<setiosflags(ios::showpos)<<38<<""<<-38<<end1;的输出结果为【 】。
第8题:
请将下列类定义补充完整,横线处应填加语句______。
class TestClass{public:void fun(){cout<<"Base::fun"<<end1;}};
class TestClass1:public TestClass
{
public:
voidfun()
{
______;//显示调用基类的fun函数
cout<<"TestClass1::fun"<<end1;
}
};
第9题:
执行语句: cout<<setfill('*')<<setw(10)<<setfill('#')<<left<<123 <<"OK"<<end1;后将输出
A.123*******OK
B.123#######OK
C.123*********OK********
D.123#######OK########
第10题:
执行下列语句: #include<iostream> using namespace std; int main() { int x=3; if(x=5) cout<<x++<<end1; else cout<<x<<end1; return 0; } 程序的输出是( )。
A.3
B.4
C.5
D.6