题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-03 19:46:08

[单选题]下面代码的输出结果为 int func(int x) { int countx =0; while(x) { countx ++; x = x&(x-1); } return countx; } int main() { cout<<func(0xFF)<<" "; getch(); return 0; }
A.255
B.8
C.12
D.6

更多"[单选题]下面代码的输出结果为 int func(int x) { "的相关试题:

[单选题]阅读下面代码,输出结果为() int main() { char str1[] = "abc"; char str2[] = "abc"; const char str3[] = "abc"; const char str4[] = "abc"; const char *str5 = "abc"; const char *str6 = "abc"; cout<A. true false true
B. false true true
C. false false false
D. false false true
[单选题]下面代码的输出结果是:()
Public class Main {
Public static void main(String[] args) {
Int n1 = 1;
Int n2 = 2;
N1 = n1 + n2;
N2 = n1 - n2;
N1 = n1 - n2;
System.out.println(n1 + "," + n2);
}
}
A. 1,2
B. 2,1
C. 1,3
D. 3,2
[单选题]下面程序输出的结果是( )。
Int main()
{ int i;
int a[3][3]={1,2,3,4,5,6,7,8,9};
for(i=0;i<3;i++)
cout < return 0;
}
A. 1 5 9
B. 7 5 3
C. 3 5 7
D. 5 9 1
[单选题]
(单选题)下面的代码输出的结果是()
Var name="Tom";
Function foo(){
Console.log(name);
Var name="Jerry";
Console.log(name);
}
Foo();
A.undefined
"Jerry"
B."Tom"
"Jerry"
C."Tom"
Undefined
D."Jerry"
"Jerry"
[单选题]【单选题】
(单选题)下面的代码输出的结果是()
Var name="Tom";
Function foo(){
Console.log(name);
Var name="Jerry";
Console.log(name);
}
Foo();
A.undefined
"Jerry"
B."Tom"
"Jerry"
C."Tom"
Undefined
D."Jerry"
"Jerry"
[单选题] 以下代码的输出结果是()
Int x = 10;
X = x++ +10;
System.out.println(x);
A.11
B.10
C.21
D.20
[单选题]假设今天是2006年4月1日星期六,请问以下javascript代码输出结果是:( ) var time = new Date( ); document.write(time.getMonth( ));
A.3
B.4
C.5
D.2
[单选题]分析下面的JavaScript代码段,输出结果是( ) var mystring="I am a student"; a=mystring.charAt(9); document.write(a);
A.I am a st
B.U
C.Udent
D.T
[单选题]分析下面的 Javascript 代码段,输出结果是() var mystring=”I am a student”; var a=mystring.substring(9,13); document.write(a);
A.stud
B.tuden
C.uden
D.udent
[单选题]执行下列代码,程序的输出结果是(用下划线表示空格):( ) int a=29,b=100; cout <A.29_100
B._29_100
C.29100
D._29100
[简答题]写出下面程序运行时的输出结果。
Int i = 1 , sum = 0 ;
While ( true )

Sumn + = i ;
I++;
If ( i > 1 0 ) break ;

Console . WriteLine ( sum ) ;
[单选题]分析下面的 Javascript 代码段,输出结果是() var s1=parseInt(“101 中学”); document.write(s1);
A.NaN
B.101 中学
C.101
D.出现脚本错误
[单选题]下面程序的输出结果是( )
Int i=0,j=0,a=6;
If((++i>0)||(++j>0)) a++;
Printf("i=%d,j=%d,a=%d\n",i,j,A.;
A.i=0,j=0,a=6
B.i=1,j=0,a=7
C.i=1,j=1,a=6
D.i=1,j=1,a=7
[单选题]现有如下程序,则程序的输出结果为( )。
Int f(int
A,int b)
{ int c;
if(a>0&&a<10) c=(a+b)/2;
else c=a*b/2;
return c;
}
Int main()
{ int a=8,b=20,c;
c=f(a,b);
cout << c << endl;
return 0;
}
A. 随机数
B. 80
C. 28
D. 14
[单选题]下列代码的输出结果是 : ( ) class Parent{ void printMe() { System.out.println("parent"); } }; class Child extends Parent { void printMe() { System.out.println("child"); } void printall() { super.printMe(); this.printMe(); printMe(); } } public class Test_this { public static void main(String args[]) { Child myC=new Child(); myC.printall(); } }
A.parent child child
B.parent child parent
C.parent child
D.编译错误
[单选题]下面代码执行结果为() class A { public: void B() { cout<<"want func ptr"; } }; int main() { void (A::*func)() = &A::B; A a; (a.*func)(); return 0; }
A.want func ptr
B.编译错误,A类中没有成员*func函数
C.没有任何输出
D.不能A::B取地址
[单选题]以下程序的输出结果是( )。
Int f()
{ static int i=0;
int s=1;
s+=i; i++;
return s;
}
Int main()
{ int i,a=0;
for(i=0;i<5;i++)
a+=f();
cout << a << endl;
return 0;
}
A. 20
B. 24
C. 25
D. 15
[单选题]分析下面的JavaScript代码段,输出的结果是( )。 emp=new Array(5); emp[1]=1; emp[2]=2; document.write(emp.length);
A.2
B.3
C.4
D.5
[单选题]阅读以下代码,输出结果为() class A { public: virtual void a()=0; virtual ~A(){} }; class AA:public A { public: void a() { cout<<"nihao 2\n"; } ~AA() { cout<<"delete AA \n"; } }; class AAA:public AA { public: void a() { cout<<"nihao 3 \n"; } ~AAA() { cout<<"delete AAA \n"; } }; class B { public: A *b(int kind) { if(kind == 1) return new AA; else return new AAA; } ~B() { cout<<"delete B\n"; } }; int main() { B *bb = new B; A *aa = bb->b(1); aa->a(); aa = bb->b(2); aa->a(); delete aa; delete bb; return 0; }
A. nihao2 nihao3 delete AA delete AAA delete B
B. nihao3 nihao3 delete AAA delete AA delete B
C. nihao2 nihao2 delete AAA delete AA delete B
D. nihao2 nihao3 delete AAA delete AA delete B

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码