A.5
B.6
C.7
D.8
第1题
下面程序运行输出的结果是【 】。
include <iostream>
using namespace std;
int main(){
char a[]="Chinese";
a[3]='\0';
cout<<a<<endl;
return 0;
}
第2题
下面程序的运行结果是()。 #include <iostream> using namespace std; #define SUB(X, Y) (X)*Y void main() { int a=3, b=4; cout< <sub(a++,> A、12
B、15
C、16
D、20
第3题
以下程序的运行结果是 。 #include <iostream> using namespace std; void main() { int a = 0, b = 1; for (; a<5 5="=" ; a++, b++) { if ((a+b ) % 0) continue; b +="a;" } , \n";>
第4题
下面程序的执行结果是【 】。
include<iostream>
include<iomanip>
using namespace std;
void main()
{
cout<<setfill('x')<<setw(10);
cout<<"Hello"<<endl;
}
第5题
运行程序,程序运行结果是(). #include <iostream> using namespace std; int main() { char a[3]={’a’,’b’,’c’},*p=a+1; cout<
< <endl; return 0;> A、b
B、bc
C、abc
D、不确定
</endl;>
第6题
当输入10,11,12时,下面程序运行结果是【 】。
include<iostream>
using namespace std;
int main()
{
int a,b,C,max;
cin>>a>>b>>C;
if(max<b)
max=b;
if(max<c)
max=c;
cout<<max<<endl;
return 0;
}
第7题
下面程序执行的结果是【 】
include<iostream>
using namespace std;
class A{
public:
static int x;
A(inty){cout<<x+y;}
};
int A::x=2;
void main(){
A a(5);
}
第8题
下面程序运行后输出的结果是【 】。
include <iostream>
using namespace std;
class example{
const int m;
public:
example(int i):m(i){}
void pr(){cout<<"m="<<m<<endl'}
};
int main(){
example x(100);
x.pr();
return 0;
}
第9题
以下程序的运行结果是【 】。
include<iostream>
include<string>
using namespace std;
void main(){
chara[10]="China",b[]="Chin",c[]="ese";
cout<<strlen(strcat(strcpy(a,b),c))<<endl;
}
第10题
以下程序的输出结果是 。 #include <iostream> #include <iomanip> using namespace std; void main() { int i; for (i=1;i>=0;) cout< <i--;>
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!