会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xpp
CnBlogs
Home
New Post
Contact
Admin
Subscription
2014年8月9日
编程之美——二进制数中1的个数
解法一:若二进制末尾为1,则除以2余1;int count(int a){ int num=0; while(a) { if(a%2==1) ++num; a=a/2; } return num;}解法二:使用移位操作相...
Read More
posted @ 2014-08-09 20:41 chengcy
Views(145)
Comments(0)
Diggs(0)
公告