下列程序的运行结果是 。 #include <iostream> using namespace std; void main() { int i, j, y=122, a[8]; for(i=0; y; i++) { a[i]=y%8; y=y/8; } for(j=i-1; j>=0; j--) cout< <a[j]; endl; “y="”<<y<<endl;">
第2题
A.hello,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
第3题
include<iostream>
using namespace std;
void main()
{
int num=0,i=8;
do
{
i--;
num++;
}while(--i);
cout<<num<<endl;
}
第4题
#included<iostream>
usingnamespacestd;
intmain()
{
chara[]="Hell0,Test";
char*p=a;
while(*p)
{
if(*p>='a'&&*p<='z')
cout<<char(*p+'A'-'a');
elsecout<<*P;
p++;
}
return0;
}
A.hello,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
第5题
A.Base Base
B.Base Derived
C.Derived Base
D.Derived Derived
第6题
A.functionl运行1次,function2运行2次
B.functionl运行2次,function2运行l次
C.functionl运行2次,function2运行3次
D.functionl运行2次,function2运行2次
第7题
#include<iostream>
usingnamespacestd;
voidfunction2(intn);
voidfunctionl(intn):{
if(n<=0)return;
function2(n-2);
}
voidfunction2(intn){
if(n<=O)return;
functionl(n-1);
}
intmain(){
functionl(5);
return0;
}
下列关于程序运行情况的描述中,正确的是( )。
A.functionl运行1次,function2运行2次
B.functionl运行2次,function2运行l次
C.functionl运行2次,function2运行3次
D.functionl运行2次,function2运行2次
第8题
A.①②③④
B.①②③
C.②③④
D.①④
第9题
A. Base.fun;
B.Base::fun;
C.Base—>fun;
D.fun;
第10题
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
int S[]={123,234};
cout<<right<<setfill(‘*’)<<setw(6);
for(int i=0;i<2;i++){cout<<s[i]<<endl;}
retum 0;
}
运行时的输出结果是
A.123
B.***123
C.***123
D.***123 234 234 ***234 234***
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!