#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int num = -1;
unsigned int s = num;              //当前位级表示即为最大无符号数
cout << (int)log2(s)+1 << endl; //第一种

int intSize = 0;
while(s != 0)
{
s = s >> 1;
intSize = intSize + 1;
}
cout << intSize << endl; //循环处理也行

int n = 1;        //直接用1,移位,,直到为0
int cn = 0;
while(n!=0)
{
n = (n << 1);
cn++;
}
cout << cn<< endl;
return 0;
}

最新文章

  1. RPC 使用中的一些注意点
  2. Find out files transfered via Bluetooth
  3. Linux压缩那些事儿
  4. python操作mongodb之基础操作
  5. POJ 3691 AC自动机上的dp
  6. 螺旋矩阵 noip2014普及组
  7. tornado学习精要
  8. 第五、六章:图像&amp;链接
  9. Codeforces Round #415(Div. 2)-810A.。。。 810B.。。。 810C.。。。不会
  10. AngularJS从入门到精通
  11. 从零开始unity特效(持续追加中)
  12. Uniform Generator HDU1014
  13. what&#39;s the 数据结构
  14. java.net.UnknownHostException: www.terracotta.org
  15. Mysql - 参数修改
  16. 基于redis分布式缓存实现(新浪微博案例)转
  17. Day 49 CSS样式.
  18. 基于mosquitto的MQTT服务器---SSL/TLS 单向认证+双向认证
  19. Android中Application类的使用
  20. &lt;Android 应用 之路&gt; 百度地图API使用(2)

热门文章

  1. Windows 10 安装
  2. Mysql++详解
  3. C#中数组、ArrayList和List三者的区别(转)
  4. C#中两个整数相除得到带小数点的结果
  5. 简单的web三层架构系统【第二版】
  6. spring MVC中文乱码相关总结
  7. DEV中gridview常用属性的设置
  8. Cookie管理
  9. (转)原子操作 Interlocked系列函数
  10. C++对象模型6--对象模型对数据访问的影响