单选题下列语句分别是不同程序中的第一个输入输出语句,若去掉其中的''<<left",输出效果将发生变化的是( )。
单选题对于语句“cout<<setfill("*")<<setw(10)<<1<<setfill("*")<<setw(2)<<2;”的输出结果是______。
单选题下面程序的运行结果为( )。
#include<iostream.h>
void main( )
{
char a=,''3'';
switch(a)
{
case''3'':cout < < "3";
case''2'':cout < < "2";break;
default:cout < < "1";
}
}
单选题派生类的成员函数不能访问基类的______。
单选题以下模板定义: template<class T> T fun(T x,T y)return x*x+y*y; 下面对fun的调用中错误的是( )。
单选题下列程序用来判断数组中特定元素的位置所在,则输出结果为( )。 #include<conio.h> #include<iostream.h> int fun(int*p,int n,int*j) int i; *j=0; for(i=0;i<n;i++) if(p[*j]<p[i])*j=i; return p[*j]; void main() int a[10]=1,3,9,0,8,7,6,5,4,2)j;int j; fun(a,10, cout<<j<<','<<a[j];
单选题下面是一个模板声明的开始部分: templute<typename T> double 由此可知( )。
单选题用数组表示线性表的优点是
单选题已知语句int m=10;则下列引用的表示中正确的是
A. int
B. int
C. int
D. float
单选题有以下程序:
#include <iostream>
using namespace std;
class sample
{
pnvate:
int x;
static int y;
public:
sample(int a);
static void print(sample s);
};
sample::sample(int a)
{
x=a;
y+=x;
}
void sample::print(sample s)
{
cout<<"x="<<s.x<<",y="<<y<<endl;
}
int sample::y=0;
int main()
{
sample s1(10);
sample s2(20);
sample::print(s2);
return 0;
}
程序运行后的输出结果是
____
。
单选题设有char str[80]以下不能将输入数据first\nsecond\n<CR>读取到数组sir中的语句是
单选题已知程序中已经定义了函数test,其原型是int test(int,int,int);,则下列重载形式中正确的是( )。 A.char test(int,int,int); B.double test(int,int,double); C.int test(int,int,int=0); D.float test(int,int,float=3.5F);
单选题在下列程序画线处填入的正确语句是( )。 #include <iostream> using namespace std; class Base { public: void fun() { cout<<"Base::fun",<<end1; } }; class Derived:public Base { void fun() { ______________ //显式调用基类的函数fun() cout<<"Derived::fun" <<end1; } };
单选题this指针是C++语言实现什么的一种机制? A) 抽象 B) 封装 C) 继承 D) 重载
单选题若执行以下程序时从键盘上输入9,则输出结果是( )。 main() {int n; cin>>n; if(n++<10)cout<<n<<endl; else cout<<n--<<endl; }
单选题有如下程序段:
int i=1;int j=4;
int main(){
int j=i,i=8;
Cout<<i<<j<<endl;
}
运行时的输出结果是______。
单选题线性表L=(a1,32,a3,…ai,…an),下列说法正确的是
单选题有如下程序:
#include
#include
using namespace std;
class Wheel{
public:
Wheel(string s="W"):name(s) { cout<
单选题有如下程序
#include<iostream>
using namespace std;
int main(){
char a;
cin>>a;
if(a="*") cout<<"***"<<endl;
else cout<<"###"<<endl;
return 0;
}
输入字符+时,程序的运行结果是______。
单选题软件生命周期可分为定义阶段、开发阶段和维护阶段,下面属于开发阶段任务的是
