//
// main.cpp
// 160929
//
// Created by liuzhe on 16/9/29.
// Copyright © 2016年 my_code. All rights reserved.
//
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <bitset>
using namespace std;
//一个八位2进制,高4位不变,低4位取反
int main(){
bitset<8>b(string("11011101"));
cout<<"原容器位:"<<b.to_string()<<endl;
for(int i=0;i<4;i++)//fanzhuan
{
b.flip(i);
}
//bitset<8>b2(string("00001111"));
//b^=b2;
cout<<b.to_string()<<endl;
return 0;
}
bitset一个八位2进制,高4位不变,低4位取反
最新推荐文章于 2021-05-23 15:54:06 发布