제2 3 템 플 릿 18.3.5 비트 집합
2344 단어 집합 하 다.
// 18.3.5
//Bitsets , Bitsets , != == &= ^= |= ~ <<= >>= []
//1 Bitsets
/*#include <iostream>
#include <bitset>
using namespace std;
int main()
{
bitset<8>bs( (long)131 );
for(int i=(int)bs.size()-1; i>=0; i--)
{
cout<<bs[i]<<" ";
}
cout<<endl;
cout<<bs<<endl;
system("pause");
return 0;
}*/
//2 Bitsets
//bitset
//!= == &= ^= |= ~ <<= >>= []
/*
!= bitset
== bitset
&= bitset
^= bitset
|= bitset
~ bitset
<<= bitset
>>= bitset
[x] x
*/
/*
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
bitset<8>bs( (long)131 );
cout<<bs<<endl;
cout<<~bs<<endl;
system("pause");
return 0;
}*/
//3 Bitsets
//any() , true
//cout()
//flip() bits
//none() , true
//reset()
//set()
//size()
//test()
//to_string() bitset
//to_ulong() ibtset
/*
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
bitset<8>bs( (long)131 );
//cout<<bs<<endl;
//cout<<~bs<<endl;
//(1) flip() ~
cout<<"flip:"<<bs.flip()<<endl;
//(2) none
cout<<"none:"<<bs.none()<<endl;
//(3)any() none()
cout<<"any:"<<bs.any()<<endl;
//(4) reset();
//bs.reset();
//cout<<"none:"<<bs.none()<<endl;
//(5)size
cout<<"size:"<<bs.size()<<endl;
//(6)test()
cout<<"test:"<<bs.test(3)<<endl;
//(7)set()
cout<<bs<<endl;
bs.set(0,1);
cout<<bs<<endl;
//(8)to_string()
string str = bs.to_string();
cout<<str<<endl;
//(9)to_ulong()
unsigned long ul = bs.to_ulong();
cout<<ul<<endl;
//(10) cout()
cout<<bs.count()<<endl;
system("pause");
return 0;
}*/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
알고리즘 의 미소스 코드 발표 (9)내용 소개: 비밀 알고리즘 세 계 를 탐색 하고 데이터 구조의 길 을 모색 한다.전형 적 인 문 제 를 모 아 프로 그래 밍 기법 의 취 미 를 즐 깁 니 다.구직 핫 이 슈 를 지적 하여 개업 계 의 유명 기업 의...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.