首页 > 其他 > 详细

bitset使用

时间:2014-09-02 22:48:15      阅读:221      评论:0      收藏:0      [点我收藏+]

17.10使用序列1、2、3、5、8、13、21初始化一个bitset,将这些位置置位。对另一个bitset进行默认初始化,并编写一小段程序将其恰当的位置位。

#include<iostream>
#include<bitset>
using namespace std;
int main()
{
    bitset<32> bits("100000001000010010111");
    bitset<32> bit;
    bit.set(1);
    bit.set(2);
    bit.set(3);
    bit.set(5);
    bit.set(8);
    bit.set(13);
    bit.set(21);
}

 

bitset使用

原文:http://www.cnblogs.com/wuchanming/p/3952423.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!