Part I.ѡ:(70)
1.ֵx=9999;
int func(x)
{
int countx = 0;
while(x)
{
countx ++;
x = x&(x-1);
}
return countx;
}
2.Ϊʲôؾֲòã
a,b,c,dǵˣźڴ棬ֵȵйء
3.Stack R,from the top to bottom:{2,3,4,5,6},ȡQueue Q ٴQȡRУ
ϵRԪصУ
4.ԼʲôCLASSVIEWΪģ
(a) (b)캯 (c)캯 (ǵûһ) (d)ǵˣ
5.дĽ___________ __________________
int funa(int *a)
{
a[0] ++;
}
int funb(int b[])
{
b[1] += 5;
}
main()
{
int a[5] = {2,3,4,5,6};
int b[5] = {2,3,4,5,6};
int *p;
p = &a[0];
(*p)++;
funb(p);
for(int i = 0; i <5; i++)
printf("%d,",a[i]);
p = &b[1];
funa(p);//(дʱŷˣb[1]ĵַֻǵôַָˣʱ
//b.ҪDZһεfunbˡǺ)
funb(p);
for(i = 0; i < 5; i++)
printf("%d,",b[i]);
}
18.һ˵⣬öӢĵʲʶûŪ˼Ҳûмǵõдɣ÷һһءȻп
һ˵type errorĺô
1.ֵx=9999;
int func(x)
{
int countx = 0;
while(x)
{
countx ++;
x = x&(x-1);
}
return countx;
}
2.Ϊʲôؾֲòã
a,b,c,dǵˣźڴ棬ֵȵйء
3.Stack R,from the top to bottom:{2,3,4,5,6},ȡQueue Q ٴQȡRУ
ϵRԪصУ
4.ԼʲôCLASSVIEWΪģ
(a) (b)캯 (c)캯 (ǵûһ) (d)ǵˣ
5.дĽ___________ __________________
int funa(int *a)
{
a[0] ++;
}
int funb(int b[])
{
b[1] += 5;
}
main()
{
int a[5] = {2,3,4,5,6};
int b[5] = {2,3,4,5,6};
int *p;
p = &a[0];
(*p)++;
funb(p);
for(int i = 0; i <5; i++)
printf("%d,",a[i]);
p = &b[1];
funa(p);//(дʱŷˣb[1]ĵַֻǵôַָˣʱ
//b.ҪDZһεfunbˡǺ)
funb(p);
for(i = 0; i < 5; i++)
printf("%d,",b[i]);
}
18.һ˵⣬öӢĵʲʶûŪ˼Ҳûмǵõдɣ÷һһءȻп
һ˵type errorĺô
本文详细解析了C语言中的位运算技巧及其应用,包括如何通过位运算计算整数中1的个数,以及指针操作在函数传参中的具体表现。同时探讨了栈与队列的基本操作,并对CLASSVIEW的应用场景进行了分析。
5万+

被折叠的 条评论
为什么被折叠?



